notesmachine/server/nm-store/src/errors.rs

19 lines
444 B
Rust

use sqlx;
use thiserror::Error;
/// All the ways looking up objects can fail
#[derive(Error, Debug)]
pub enum NoteStoreError {
/// When building a new note for the back-end, it failed to parse
/// in some critical way.
#[error("Invalid Note Structure")]
InvalidNoteStructure(String),
#[error("Not found")]
NotFound,
/// All other errors from the database.
#[error("Sqlx")]
DBError(#[from] sqlx::Error),
}