A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
status.cc File Reference
#include "a11/status.h"
#include <exception>
#include <string>
#include <utility>
#include <absl/strings/cord.h>
#include <absl/strings/str_cat.h>
#include <nlohmann/json.hpp>

Namespaces

namespace  a11
 

Functions

absl::StatusCode a11::StatusCodeFromHttp (int http_code)
 Maps an HTTP status code to a canonical status code.
 
int a11::StatusCodeToHttp (absl::StatusCode code)
 Maps a canonical status code to its HTTP status code.
 
absl::StatusCode a11::StatusCodeFromWebSocket (std::uint16_t close_code)
 Maps a WebSocket close code to a canonical status code.
 
std::uint16_t a11::StatusCodeToWebSocket (absl::StatusCode code)
 Maps a canonical status code to its WebSocket close code.
 
absl::Status a11::MakeStatus (absl::StatusCode code, std::string message, nlohmann::json details)
 Builds a status carrying an A11 structured-details payload.
 
nlohmann::json a11::StatusDetails (const absl::Status &status)
 Extracts the structured-details payload from a status.
 
absl::StatusOr< nlohmann::json > a11::StatusToJson (const absl::Status &status)
 Serializes a status (code, message, details) to JSON.
 
absl::StatusOr< absl::Status > a11::StatusFromJson (const nlohmann::json &value)
 Reconstructs a status from its JSON representation.