Lines Matching defs:error

3 #![cfg_attr(not(feature = "error-context"), allow(dead_code))]
4 #![cfg_attr(not(feature = "error-context"), allow(unused_imports))]
5 #![cfg_attr(not(feature = "error-context"), allow(unused_variables))]
6 #![cfg_attr(not(feature = "error-context"), allow(unused_mut))]
7 #![cfg_attr(not(feature = "error-context"), allow(clippy::let_and_return))]
13 error,
28 #[cfg(feature = "error-context")]
37 #[cfg(feature = "error-context")]
39 #[cfg(feature = "error-context")]
41 #[cfg(feature = "error-context")]
44 #[cfg(not(feature = "error-context"))]
46 #[cfg(feature = "error-context")]
56 /// See [`Command::error`] to create an error.
58 /// [`Command::error`]: crate::Command::error
67 #[cfg(feature = "error-context")]
70 source: Option<Box<dyn error::Error + Send + Sync>>,
78 /// Create an unformatted error
80 /// This is for you need to pass the error up to
83 /// Prefer [`Command::error`] for generating errors.
85 /// [`Command::error`]: crate::Command::error
101 /// Create an error with a pre-defined message
109 #[cfg_attr(not(feature = "error-context"), doc = " ```ignore")]
110 #[cfg_attr(feature = "error-context", doc = " ```")]
111 /// # use clap::error::ErrorKind;
112 /// # use clap::error::ContextKind;
113 /// # use clap::error::ContextValue;
128 #[cfg(feature = "error-context")]
141 /// Apply [`Command`]'s formatting to the error
150 /// Apply an alternative formatter to the error
157 /// # use clap::error::KindFormatter;
172 /// Type of error for programmatic processing
177 /// Additional information to further qualify the error
178 #[cfg(feature = "error-context")]
185 #[cfg(feature = "error-context")]
192 #[cfg(feature = "error-context")]
210 /// Prints the error and exits.
212 /// Depending on the error kind, this either prints to `stderr` and exits with a status of `2`
227 /// Prints formatted and colored error to `stdout` or `stderr` according to its error kind
257 /// Render the error message to a [`StyledStr`].
288 pub(crate) fn set_source(mut self, source: Box<dyn error::Error + Send + Sync>) -> Self {
310 #[cfg(feature = "error-context")]
322 #[cfg(feature = "error-context")]
355 #[cfg(feature = "error-context")]
382 #[cfg(feature = "error-context")]
404 #[cfg(feature = "error-context")]
434 #[cfg(feature = "error-context")]
472 #[cfg(feature = "error-context")]
494 #[cfg(feature = "error-context")]
517 #[cfg(feature = "error-context")]
538 #[cfg(feature = "error-context")]
557 #[cfg(feature = "error-context")]
581 #[cfg(feature = "error-context")]
606 err: Box<dyn error::Error + Send + Sync>,
610 #[cfg(feature = "error-context")]
630 #[cfg(feature = "error-context")]
661 #[cfg(feature = "error-context")]
718 #[cfg(feature = "error-context")]
771 impl<F: ErrorFormatter> error::Error for Error<F> {
773 fn source(&self) -> Option<&(dyn error::Error + 'static)> {