# ErrorHandler.hpp
This File On Github
Ask A Question
API: latest
module: oatpp
#include "oatpp/web/server/handler/ErrorHandler.hpp"
# ErrorHandler
Error Handler.
namespace oatpp { namespace web { namespace server { namespace handler {
class ErrorHandler {}
}}}}
# Typedefs
Type | Name | Summary |
---|---|---|
web::protocol::http::Headers | Headers | Convenience typedef for Headers. See oatpp::web::protocol::http::Headers |
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | ~ErrorHandler | Virtual destructor since the class is ment to be derived from. |
std::shared_ptr<protocol::http::outgoing::Response> | handleError | Multiple implementations:
|
# ErrorHandler::Headers
Convenience typedef for Headers.
See oatpp::web::protocol::http::Headers
typedef web::protocol::http::Headers Headers
# ErrorHandler::~ErrorHandler
Virtual destructor since the class is ment to be derived from. */
virtual ~ErrorHandler() = default
# ErrorHandler::handleError
- Implement this method!
- @param status - oatpp::web::protocol::http::Status.
- @param message - oatpp::String.
- @param Headers - oatpp::web::protocol::http::Headers
- @return - std::shared_ptr to oatpp::web::protocol::http::outgoing::Response.
virtual std::shared_ptr<protocol::http::outgoing::Response> handleError(const protocol::http::Status& status, const oatpp::String& message, const Headers& headers) = 0
- Convenience method to call
handleError
method with no headers.- @param status - oatpp::web::protocol::http::Status
- @param message - oatpp::String.
- @return - std::shared_ptr to oatpp::web::protocol::http::outgoing::Response.
std::shared_ptr<protocol::http::outgoing::Response> handleError(const protocol::http::Status& status, const oatpp::String& message)
# DefaultErrorHandler
Default Error Handler.
namespace oatpp { namespace web { namespace server { namespace handler {
class DefaultErrorHandler : public oatpp::base::Countable, public ErrorHandler {}
}}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | DefaultErrorHandler | Constructor. |
std::shared_ptr<DefaultErrorHandler> | createShared | Create shared DefaultErrorHandler. |
std::shared_ptr<protocol::http::outgoing::Response> | handleError | Implementation of ErrorHandler::handleError() |
# DefaultErrorHandler::DefaultErrorHandler
Constructor.
DefaultErrorHandler()
# DefaultErrorHandler::createShared
Create shared DefaultErrorHandler.
- @return -
std::shared_ptr
to DefaultErrorHandler.
static std::shared_ptr<DefaultErrorHandler> createShared()
# DefaultErrorHandler::handleError
Implementation of ErrorHandler::handleError()
- @param status - oatpp::web::protocol::http::Status.
- @param message - oatpp::String.
- @return - oatpp::web::protocol::http::outgoing::Response.
std::shared_ptr<protocol::http::outgoing::Response>
handleError(const protocol::http::Status& status, const oatpp::String& message, const Headers& headers) override