27 #include <boost/type_index.hpp> 37 converted_msg.uuid = msg.
uuid;
38 converted_msg.type = msg.
type;
46 static std::string exception_name(
const std::exception_ptr &ptr)
51 std::rethrow_exception(ptr);
54 catch (
const std::exception &e)
56 auto type_index = boost::typeindex::type_id_runtime(e);
57 return type_index.pretty_name();
64 std::string ename = exception_name(ptr);
68 std::rethrow_exception(ptr);
112 WARN(
"Leosac specific exception has been caught: " << e.
what() << std::endl
117 catch (
const odb::exception &e)
119 ERROR(
"Database Error: " << e.what());
121 response.
status_string =
"Database Error: " + std::string(e.what());
123 catch (
const std::exception &e)
125 WARN(
"Exception when processing request: " << e.what());
The session has been aborted.
json json_errors() const
Format the ModelError object(s).
An internal database operation threw an exception.
An exception class for general API error.
virtual ServerMessage convert_impl(const std::exception_ptr &ptr)
This is the header file for a generated source file, GitSHA1.cpp.
std::string status_string
One of the argument of the call had a invalid value / type.
APIStatusCode status_code
The API method (ie, message's type) does not exist.
virtual const char * what() const noexcept final
An exception that can be throw when the permission for a given operation is denied.
const std::string & entity_type() const
All modules that provides features to Leosac shall be in this namespace.
The requested entity cannot be found.
A class to represents invalid argument exception in Leosac.
The source packet was malformed.
The websocket connection is not allowed to make the requested API call.
const std::string & entity_id() const
#define BUILD_STR(param)
Internal macro.
A base class for Leosac specific exception.
A message sent by the server to a client.
const Leosac::Tools::Stacktrace & trace() const
Get the stacktrace associated with this exception.
Some internal API rules has failed.
A failure for an unknown reason.
ServerMessage convert_merge(const std::exception_ptr &ptr, const ServerMessage &msg)
Convert the exception_ptr to a ServerMessage and merge it with an other message.