cdumay_error_json
A utility crate that converts serde_json::Error into structured, typed errors using the cdumay_error framework. This ensures consistent error handling, easier debugging, and informative error reporting across your Rust applications.
Features
- Categorizes
serde_json::Errorinto specific error types (Syntax,IO,Data,EOF) - Each error type is associated with a custom code, HTTP status, and descriptive message
- Structured output for APIs, logging systems, and observability platforms
- Includes context metadata via
BTreeMap - Provides a convenient
convert_result!macro for error conversion
Usage
Using the JsonErrorConverter directly:
use ErrorConverter;
use Value;
use BTreeMap;
use JsonErrorConverter;
Using the convert_result! macro:
use convert_result;
use Value;
use BTreeMap;
use ErrorConverter;