LLDB mainline
UnimplementedError.h
Go to the documentation of this file.
1//===-- UnimplementedError.h ------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_UTILITY_UNIMPLEMENTEDERROR_H
10#define LLDB_UTILITY_UNIMPLEMENTEDERROR_H
11
12#include "llvm/Support/Errc.h"
13#include "llvm/Support/Error.h"
14
15namespace lldb_private {
16class UnimplementedError : public llvm::ErrorInfo<UnimplementedError> {
17 std::string m_message;
18
19public:
20 static char ID;
21
22 UnimplementedError() = default;
23 explicit UnimplementedError(std::string message)
24 : m_message(std::move(message)) {}
25
26 void log(llvm::raw_ostream &OS) const override {
27 if (!m_message.empty())
28 OS << m_message;
29 else
30 OS << "Not implemented";
31 }
32
33 std::error_code convertToErrorCode() const override {
34 return llvm::errc::not_supported;
35 };
36};
37} // namespace lldb_private
38
39#endif // LLDB_UTILITY_UNIMPLEMENTEDERROR_H
std::error_code convertToErrorCode() const override
void log(llvm::raw_ostream &OS) const override
UnimplementedError(std::string message)
A class that represents a running process on the host machine.