MantisBase v0.4.9
Loading...
Searching...
No Matches
mb::MbException Class Referencefinal

Application exception carrying an HTTP status code and messages. More...

#include <exceptions.h>

Inheritance diagram for mb::MbException:
Collaboration diagram for mb::MbException:

Public Member Functions

 MbException (int _code, std::string _msg)
 MbException (int _code, std::string _msg, std::string _desc)
const char * what () const noexcept override
const char * desc () const noexcept
int code () const noexcept

Detailed Description

Application exception carrying an HTTP status code and messages.

Thrown by entity, file, and validation layers; caught by route handlers and converted into JSON error responses.

Constructor & Destructor Documentation

◆ MbException() [1/2]

mb::MbException::MbException ( int _code,
std::string _msg )
Parameters
_codeHTTP-style status code (e.g. 400, 404).
_msgThe exception description message to show

◆ MbException() [2/2]

mb::MbException::MbException ( int _code,
std::string _msg,
std::string _desc )
Parameters
_codeHTTP-style status code (e.g. 400, 404).
_msgThe exception description message to show
_descOptional longer description for logs or API error detail.

Member Function Documentation

◆ code()

int mb::MbException::code ( ) const
nodiscardnoexcept

HTTP-style status code associated with this error.

◆ desc()

const char * mb::MbException::desc ( ) const
nodiscardnoexcept

Extended description; empty string when not provided.

◆ what()

const char * mb::MbException::what ( ) const
nodiscardoverridenoexcept

The documentation for this class was generated from the following files:
  • /home/runner/work/mantisbase/mantisbase/include/mantisbase/core/exceptions.h
  • /home/runner/work/mantisbase/mantisbase/src/core/exceptions.cpp