Class LmcServiceException
Defined in File LmcServiceException.h
Inheritance Relationships
Base Type
public std::exception
Class Documentation
-
class LmcServiceException : public std::exception
Custom exception that can be used by.
The
The difference between the error_code and status_code is subtle but the error_code is specific to PST and provides more detail. The status_code is a common enum used within gRPC.
See also
LmcServiceHandler instances to return specific error codes.
See also
LmcService can handle any exception but it will return to the client as an internal service error. This class can be used by implementations of the
See also
LmcServiceHandler to raise a specific exception from that can provide the ska::pst::lmc::ErrorCode and the grpc::StatusCode.
Public Functions
-
inline LmcServiceException(const char *msg, ska::pst::lmc::ErrorCode error_code = ska::pst::lmc::ErrorCode::INTERNAL_ERROR, grpc::StatusCode status_code = grpc::StatusCode::INTERNAL)
Constructor for an LmcServiceException.
See also
what.
- Parameters
msg – The error message for the exception. This is returned when calling
error_code – The PST LMC Error code to use. Defaults to INTERNAL_ERROR.
status_code – the gRPC status code to use. Defaults to INTERAL.
-
virtual ~LmcServiceException() = default
-
inline ska::pst::lmc::ErrorCode error_code() const
Returns the error code for this exception.
-
inline grpc::StatusCode status_code() const
Returns the status code for this exception.
-
grpc::Status as_grpc_status()
Converts this exception into a grpc::Status object.
gRPC expects its methods to return instances grpc::Status and this method is used to convert this exception into a grpc::Status object.
-
inline const char *what() const noexcept override
Get the cause of the exception.
-
inline LmcServiceException(const char *msg, ska::pst::lmc::ErrorCode error_code = ska::pst::lmc::ErrorCode::INTERNAL_ERROR, grpc::StatusCode status_code = grpc::StatusCode::INTERNAL)