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

19 lines
444 B
Rust
Raw Normal View History

2020-11-03 02:32:01 +00:00
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),
2020-09-30 16:17:37 +00:00
#[error("Not found")]
NotFound,
/// All other errors from the database.
#[error("Sqlx")]
DBError(#[from] sqlx::Error),
}