smart-fridge 2.0.0

A tiny service to manage food in your fridge
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Module that manages any internal errors that may occur.

/// An API-friendly error type.
#[derive(thiserror::Error, Debug)]
pub enum Error {
    /// A SQLx call returned an error.
    ///
    /// The exact error contents are not reported to the user in order to avoid leaking
    /// information about databse internals.
    #[error("an internal database error occurred")]
    Sqlx(#[from] sqlx::Error),

    /// Similarly, we don't want to report random `anyhow` errors to the user.
    #[error("an internal server error occurred")]
    Anyhow(#[from] anyhow::Error),
}