userver: server::handlers::JsonErrorBuilder Class Reference
No Matches
server::handlers::JsonErrorBuilder Class Reference

#include <userver/server/handlers/json_error_builder.hpp>

Detailed Description

JSON error message builder. Useful for handlers derived from HttpHandlerBase but responding via JSON.

Definition at line 14 of file json_error_builder.hpp.

Public Member Functions

 JsonErrorBuilder (const CustomHandlerException &ex)
 JsonErrorBuilder (std::string_view error_code, std::string internal_message, std::string_view external_error_body, formats::json::Value={})
const std::string & GetInternalMessage () const
const std::string & GetExternalBody () const

Static Public Member Functions

static const ::http::ContentTypeGetContentType ()

Static Public Attributes

static constexpr bool kIsExternalBodyFormatted = true

Member Function Documentation

◆ GetContentType()

static const ::http::ContentType & server::handlers::JsonErrorBuilder::GetContentType ( )

Definition at line 28 of file json_error_builder.hpp.

◆ GetExternalBody()

const std::string & server::handlers::JsonErrorBuilder::GetExternalBody ( ) const

Definition at line 26 of file json_error_builder.hpp.

◆ GetInternalMessage()

const std::string & server::handlers::JsonErrorBuilder::GetInternalMessage ( ) const

Definition at line 24 of file json_error_builder.hpp.

Member Data Documentation

◆ kIsExternalBodyFormatted

constexpr bool server::handlers::JsonErrorBuilder::kIsExternalBodyFormatted = true

Definition at line 16 of file json_error_builder.hpp.

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