Module sylvia_iot_corelib::err
source · Expand description
To generate HTTP error response.
use sylvia_iot_corelib::err::ErrResp;
// To generate HTTP request body format error.
if format_error(body) {
return Err(ErrResp::ErrParam(Some("input format error".to_string())));
}
Enums§
- The standard error definitions.
Constants§
- 401, token not authorized.
- 503, database error.
- 503, internal service communication error.
- 404, resource (in path) not found.
- 400, request (body) format error.
- 403, invalid permission.
- 503, allocate resource error.
- 500, unknown error.
Functions§
- To generate error JSON string for HTTP body.