LLDB mainline
lldb_protocol::mcp::MCPError Class Reference

#include <MCPError.h>

Inheritance diagram for lldb_protocol::mcp::MCPError:
[legend]

Public Member Functions

 MCPError (std::string message, int64_t error_code=kInternalError)
void log (llvm::raw_ostream &OS) const override
std::error_code convertToErrorCode () const override
const std::string & getMessage () const
lldb_protocol::mcp::Error toProtocolError () const

Static Public Attributes

static char ID
static constexpr int64_t kResourceNotFound = -32002
static constexpr int64_t kInternalError = -32603

Private Attributes

std::string m_message
int64_t m_error_code

Detailed Description

Definition at line 18 of file MCPError.h.

Constructor & Destructor Documentation

◆ MCPError()

MCPError::MCPError ( std::string message,
int64_t error_code = kInternalError )

Definition at line 19 of file MCPError.cpp.

References m_error_code, and m_message.

Member Function Documentation

◆ convertToErrorCode()

std::error_code MCPError::convertToErrorCode ( ) const
override

Definition at line 24 of file MCPError.cpp.

◆ getMessage()

const std::string & lldb_protocol::mcp::MCPError::getMessage ( ) const
inline

Definition at line 27 of file MCPError.h.

References m_message.

◆ log()

void MCPError::log ( llvm::raw_ostream & OS) const
override

Definition at line 22 of file MCPError.cpp.

References m_message.

◆ toProtocolError()

lldb_protocol::mcp::Error MCPError::toProtocolError ( ) const

Definition at line 28 of file MCPError.cpp.

References error(), m_error_code, and m_message.

Member Data Documentation

◆ ID

char MCPError::ID
static

Definition at line 20 of file MCPError.h.

◆ kInternalError

int64_t lldb_protocol::mcp::MCPError::kInternalError = -32603
staticconstexpr

Definition at line 32 of file MCPError.h.

◆ kResourceNotFound

int64_t lldb_protocol::mcp::MCPError::kResourceNotFound = -32002
staticconstexpr

Definition at line 31 of file MCPError.h.

Referenced by lldb_protocol::mcp::Server::ResourcesReadHandler().

◆ m_error_code

int64_t lldb_protocol::mcp::MCPError::m_error_code
private

Definition at line 36 of file MCPError.h.

Referenced by MCPError(), and toProtocolError().

◆ m_message

std::string lldb_protocol::mcp::MCPError::m_message
private

Definition at line 35 of file MCPError.h.

Referenced by getMessage(), log(), MCPError(), and toProtocolError().


The documentation for this class was generated from the following files: