LLVM 22.0.0git
llvm::lsp::LSPError Class Reference

This class models an LSP error as an llvm::Error. More...

#include "llvm/Support/LSP/Protocol.h"

Inheritance diagram for llvm::lsp::LSPError:
[legend]

Public Member Functions

 LSPError (std::string message, ErrorCode code)
void log (raw_ostream &os) const override
 Print an error message to an output stream.
std::error_code convertToErrorCode () const override
 Convert this error to a std::error_code.
Public Member Functions inherited from llvm::ErrorInfo< LSPError >
const void * dynamicClassID () const override
bool isA (const void *const ClassID) const override
Public Member Functions inherited from llvm::ErrorInfoBase
virtual ~ErrorInfoBase ()=default
virtual std::string message () const
 Return the error message as a string.
template<typename ErrorInfoT>
bool isA () const

Public Attributes

std::string message
ErrorCode code

Static Public Attributes

static char ID

Additional Inherited Members

Static Public Member Functions inherited from llvm::ErrorInfo< LSPError >
static const void * classID ()
Static Public Member Functions inherited from llvm::ErrorInfoBase
static const void * classID ()

Detailed Description

This class models an LSP error as an llvm::Error.

Definition at line 79 of file Protocol.h.

Constructor & Destructor Documentation

◆ LSPError()

llvm::lsp::LSPError::LSPError ( std::string message,
ErrorCode code )
inline

Definition at line 85 of file Protocol.h.

References code, message, and llvm::move().

Member Function Documentation

◆ convertToErrorCode()

std::error_code llvm::lsp::LSPError::convertToErrorCode ( ) const
inlineoverridevirtual

Convert this error to a std::error_code.

This is a temporary crutch to enable interaction with code still using std::error_code. It will be removed in the future.

Implements llvm::ErrorInfoBase.

Definition at line 91 of file Protocol.h.

References llvm::inconvertibleErrorCode().

◆ log()

void llvm::lsp::LSPError::log ( raw_ostream & OS) const
inlineoverridevirtual

Print an error message to an output stream.

Implements llvm::ErrorInfoBase.

Definition at line 88 of file Protocol.h.

References code, and message.

Member Data Documentation

◆ code

ErrorCode llvm::lsp::LSPError::code

Definition at line 82 of file Protocol.h.

Referenced by log(), and LSPError().

◆ ID

char LSPError::ID
static

Definition at line 83 of file Protocol.h.

◆ message

std::string llvm::lsp::LSPError::message

Definition at line 81 of file Protocol.h.

Referenced by log(), and LSPError().


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