fiberplane / fpx

Supercharge your local development
https://fiberplane.dev
MIT License
42 stars 1 forks source link

add proc macro derive for `ApiError` #97

Closed mellowagain closed 1 month ago

mellowagain commented 1 month ago

fixes FP-3863

usage:

#[derive(Debug, Error, Serialize, Deserialize, ApiError)]
#[serde(tag = "error", content = "details", rename_all = "camelCase")]
pub enum CommonError {
    #[api_error(status_code = StatusCode::INTERNAL_SERVER_ERROR)]
    #[error("Internal server error")]
    InternalServerError,
}
4tv7ty4wstgh