2020-09-29 00:33:43 +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,
|
|
|
|
|
2020-09-29 00:33:43 +00:00
|
|
|
/// All other errors from the database.
|
2020-10-08 19:18:08 +00:00
|
|
|
#[error("Sqlx")]
|
2020-09-29 00:33:43 +00:00
|
|
|
DBError(#[from] sqlx::Error),
|
|
|
|
}
|