parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
Loading...
Searching...
No Matches
error.h File Reference

ParcelError and the non-throwing surface that returns std::expected. More...

#include <stdexcept>
#include <string>
#include <utility>
Include dependency graph for error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  parcel::ParcelError
 Structured error returned by the non-throwing try_* parsing surface. More...
 
class  parcel::ParcelException
 Base class for parcel deserialization exceptions. More...
 
class  parcel::InvalidJsonException
 JSON shape was wrong (missing/non-string k, missing v, etc.). More...
 
class  parcel::KindMismatchException
 k field was present but did not match the expected kind. More...
 
class  parcel::UnknownKindException
 Registry was asked to dispatch a kind it does not know. More...
 
class  parcel::MissingFieldException
 Required struct field absent from the JSON payload. More...
 
class  parcel::TypeException
 Typed value (cast, struct field, etc.) failed conversion. More...
 

Detailed Description

ParcelError and the non-throwing surface that returns std::expected.

Throwing from_json and registry lookups remain the default. Callers that prefer a value-typed error path (a JSON parse failing for an external input, for instance) get the parallel try_* API surface that returns std::expected<cell_t, ParcelError> instead.