feat(error): introduce custom error enum for cull-gmail

- define `Error` enum to encapsulate errors from google_gmail1 and google_clis_common
- use `thiserror` crate for simplified error handling
This commit is contained in:
Jeremiah Russell
2025-10-02 13:44:58 +01:00
committed by Jeremiah Russell
parent 7640485297
commit cd149b0d53

12
src/error.rs Normal file
View File

@@ -0,0 +1,12 @@
use thiserror::Error;
/// Error messages for cull-gmail
#[derive(Debug, Error)]
pub enum Error {
/// Error from the google_gmail1 crate
#[error("Google Gmail1 says: {0}")]
GoogleGmail1(#[from] google_gmail1::Error),
/// Error from the google_clis_common crate
#[error("Google CLIs Common says: {0}")]
InvalidOptionsError(google_clis_common::CLIError, i16),
}