svc-error 0.1.1

An implementation of RFC7807: Problem Details for HTTP APIs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use http::StatusCode;
use r2d2::Error;

use crate::Error as TheError;

impl From<Error> for TheError {
    fn from(value: Error) -> TheError {
        let mut err = TheError::from(StatusCode::UNPROCESSABLE_ENTITY);
        err.set_detail(&format!("a connection pool error = '{}'", &value));
        err
    }
}