1pub mod key;
22pub mod note;
23pub mod notebook;
24
25use thiserror::Error;
26#[derive(Error, Debug)]
27pub enum JoplinReaderError {
28 #[error("Failed to read joplin folder")]
29 FolderReadError,
30 #[error("Failed to read file: {message:?}")]
31 FileReadError { message: String },
32 #[error("Failed to decrypt: {message:?}")]
33 DecryptionError { message: String },
34 #[error("Note `{note_id:?}` not found")]
35 NoteIdNotFound { note_id: String },
36 #[error("No note with text `{search_text:?}` found")]
37 NoteNotFound { search_text: String },
38 #[error("Invalid format: {message:?}")]
39 InvalidFormat { message: String },
40 #[error("Encryption key `{key:?}` not found")]
41 NoEncryptionKey { key: String },
42 #[error("No encryption text provided")]
43 NoEncryptionText,
44 #[error("No text found")]
45 NoText,
46 #[error("Unexpected end of note")]
47 UnexpectedEndOfNote,
48 #[error("Unknown encryption method")]
49 UnknownEncryptionMethod,
50 #[error("Key id mismatch")]
51 KeyIdMismatch,
52}
53
54#[cfg(test)]
55mod tests {
56 #[test]
57 fn it_works() {
58 assert_eq!(2 + 2, 4);
59 }
60}