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

16 lines
408 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),
/// All other errors from the database.
#[error(transparent)]
DBError(#[from] sqlx::Error),
}