pub enum RichError {
}Expand description
Errors produced while parsing colors, styles, or markup.
Variants§
ColorParse(String)
A color could not be parsed (rich.color.ColorParseError).
StyleSyntax(String)
A style definition could not be parsed (rich.errors.StyleSyntaxError).
Markup(String)
Console markup was malformed (rich.errors.MarkupError).
Json(String)
A JSON string could not be parsed (used by rich.json.JSON).
Regex(String)
A regular expression could not be compiled or run. Python has no rich
equivalent — it lets re.error propagate — but a caller-supplied pattern
has to fail somewhere, and returning it beats panicking.
ThemeStack(String)
The console’s base theme cannot be popped (rich.theme.ThemeStackError).
ThemeConfig(String)
A theme config file could not be read or parsed. Upstream surfaces
Python’s configparser errors (NoSectionError, DuplicateOptionError,
ParsingError, InterpolationSyntaxError) and OSError here.
NoAltScreen(String)
A screen update without the alternate screen
(rich.errors.NoAltScreen).
Console(String)
An error in console operation (rich.errors.ConsoleError).
Style(String)
An error in styles (rich.errors.StyleError).
MissingStyle(String)
No such style (rich.errors.MissingStyle).
StyleStack(String)
The style stack is invalid (rich.errors.StyleStackError).
NotRenderable(String)
An object is not renderable (rich.errors.NotRenderableError).
Live(String)
An error related to a live display (rich.errors.LiveError).
Implementations§
Source§impl RichError
impl RichError
Sourcepub fn message(&self) -> &str
pub fn message(&self) -> &str
The message upstream’s exception carries, which is what str(error)
prints there. Display prefixes it with the kind.
Sourcepub fn is_console_error(&self) -> bool
pub fn is_console_error(&self) -> bool
Whether upstream’s class derives from ConsoleError: ConsoleError
itself, StyleSyntaxError, StyleStackError, NotRenderableError,
MarkupError, LiveError and NoAltScreen.
Sourcepub fn is_style_error(&self) -> bool
pub fn is_style_error(&self) -> bool
Whether upstream’s class derives from StyleError: StyleError
itself and MissingStyle.
Trait Implementations§
impl Eq for RichError
Source§impl Error for RichError
impl Error for RichError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for RichError
Auto Trait Implementations§
impl Freeze for RichError
impl RefUnwindSafe for RichError
impl Send for RichError
impl Sync for RichError
impl Unpin for RichError
impl UnsafeUnpin for RichError
impl UnwindSafe for RichError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more