use thiserror::Error;
use crate::hotkey::HotKey;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
OsError(#[from] std::io::Error),
#[error("{0}")]
HotKeyParseError(String),
#[error("Couldn't recognize \"{0}\" as a valid HotKey Code, if you feel like it should be, please report this to https://github.com/tauri-apps/global-hotkey")]
UnrecognizedHotKeyCode(String),
#[error("Unexpected empty token while parsing hotkey: \"{0}\"")]
EmptyHotKeyToken(String),
#[error("Unexpected hotkey string format: \"{0}\", a hotkey should have the modifiers first and only contain one main key")]
UnexpectedHotKeyFormat(String),
#[error("{0}")]
FailedToRegister(String),
#[error("Failed to unregister hotkey: {0:?}")]
FailedToUnRegister(HotKey),
#[error("HotKey already registerd: {0:?}")]
AlreadyRegistered(HotKey),
#[error("Failed to watch media key event")]
FailedToWatchMediaKeyEvent,
}
pub type Result<T> = std::result::Result<T, Error>;