Most common userver HTTP handlers .
More...
enum class HandlerErrorCode {
kUnknownError
,
kClientError
,
kRequestParseError
,
kUnauthorized
,
kForbidden
,
kResourceNotFound
,
kInvalidUsage
,
kNotAcceptable
,
kConflictState
,
kPayloadTooLarge
,
kTooManyRequests
,
kServerSideError
,
kBadGateway
,
kGatewayTimeout
,
kUnsupportedMediaType
}
enum class FallbackHandler { kImplicitOptions
}
enum class UrlTrailingSlashOption {
kBoth
,
kStrictMatch
,
kDefault = kBoth
}
Defines matching behavior for paths with trailing slashes. More...
std::string_view GetCodeDescription (HandlerErrorCode )
std::string_view GetFallbackServiceCode (HandlerErrorCode )
const std::string & ToString (FallbackHandler)
FallbackHandler FallbackHandlerFromString (const std::string &fallback_str)
HandlerConfig ParseHandlerConfigsWithDefaults (const yaml_config::YamlConfig &value, const server::ServerConfig &server_config, bool is_monitor=false)
◆ Headers
◆ FallbackHandler
enum class server::handlers::FallbackHandler
strong
◆ HandlerErrorCode
Enumeration that defines protocol-agnostic handler error condition codes, used by server::handlers::CustomHandlerException .
Specific error formats can derive various defaults from the this code, e.g. HTTP status code, JSON service error code, and default error message texts.
For example, to provide an HTTP specific error code that is not presented in this enum the HTTP code should be provided via server::http::CustomHandlerException construction with the required server::http::HttpStatus .
Enumerator kUnknownError kUnknownError This value is to map possibly unknown codes to a description, shouldn't be used in client code
kClientError kInvalidRequest Invalid request data
kRequestParseError kRequestParseError
kUnauthorized kUnauthorized Client is not authorised to execute this handler
kForbidden kForbidden Requested action is forbidden
kResourceNotFound kResourceNoFound Requested resource doesn't exist
kInvalidUsage kInvalidUsage Invalid usage of the handler, e.g. unsupported HTTP method
kNotAcceptable kNotAcceptable The server cannot produce response, acceptable by the client
kConflictState kConflictState Request cannot be completed due to conflict resource state
kPayloadTooLarge kPayloadTooLarge The payload for the request exceeded handler's settings
kTooManyRequests kTooManyRequests Request limit exceeded
kServerSideError kServerSideError An error occurred while processing the request
kBadGateway kBadGateway An error occurred while passing the request to another service
kGatewayTimeout kGatewayTimeout A timeout occurred while passing the request to another service
kUnsupportedMediaType kUnsupportedMediaType Content-Encoding or Content-Type is not supported
Definition at line 30 of file exceptions.hpp .
◆ UrlTrailingSlashOption
Defines matching behavior for paths with trailing slashes.
Enumerator kBoth ignore trailing slashes when matching paths
kStrictMatch require exact match for trailing slashes in paths
Definition at line 22 of file handler_config.hpp .
◆ kFallbackHandlerMax
constexpr size_t server::handlers::kFallbackHandlerMax
constexpr
Initial value: =
static_cast< size_t > (FallbackHandler::kImplicitOptions)
Definition at line 13 of file fallback_handlers.hpp .