use thiserror::Error;
pub use crate::accelerator::AcceleratorParseError;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum Error {
#[error("This menu item is not a child of this `Menu` or `Submenu`")]
NotAChildOfThisMenu,
#[cfg(windows)]
#[error("This menu has not been initialized for this hwnd`")]
NotInitialized,
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
),
feature = "gtk"
))]
#[error("This menu has not been initialized for this gtk window`")]
NotInitialized,
#[cfg(windows)]
#[error("This menu has already been initialized for this hwnd`")]
AlreadyInitialized,
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
),
feature = "gtk"
))]
#[error("This menu has already been initialized for this gtk window`")]
AlreadyInitialized,
#[error(transparent)]
AcceleratorParseError(#[from] AcceleratorParseError),
}
pub type Result<T> = std::result::Result<T, Error>;