magpie
Loading...
Searching...
No Matches
magpie::StatusHandler500< Context > Struct Template Reference

Public Member Functions

virtual void provideErrorResponse (Context *, Request &, Response &res)
virtual void tryCall (Context *ctx, Request &req, Response &res, const std::function< void()> &errorHandled)

Member Function Documentation

◆ provideErrorResponse()

template<data::IsCommonData Context>
virtual void magpie::StatusHandler500< Context >::provideErrorResponse ( Context * ,
Request & ,
Response & res )
inlinevirtual

Provides the actual error response. This is what you want to override if you don't care much about the actual error handling process, but want to customise the response itself.

◆ tryCall()

template<data::IsCommonData Context>
virtual void magpie::StatusHandler500< Context >::tryCall ( Context * ctx,
Request & req,
Response & res,
const std::function< void()> & errorHandled )
inlinevirtual

Defines the actual error handler. This function must invoke provideErrorResponse if it's a generic interface. provideErrorResponse can be omitted if you inline the error handling logic.

Parameters
errorHandledA callback representing the code to be error-checked

The documentation for this struct was generated from the following file: