-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Templates require Scheme enum wrapping struct instance
- Remove anyhow crate from tinted-builder lib
- Loading branch information
1 parent
5c3faca
commit a0bde42
Showing
19 changed files
with
613 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use ribboncurls::RibboncurlsError; | ||
use thiserror::Error; | ||
|
||
/// An error type representing the various errors that can occur when using tinted-builder | ||
/// | ||
/// This error type is non-exhaustive, meaning additional variants may be added in future versions without | ||
/// it being considered a breaking change. The enum variants cover a range of possible issues that might | ||
/// arise during the processing of color schemes, including missing properties, deserialization errors, | ||
/// and rendering issues. | ||
#[non_exhaustive] | ||
#[derive(Error, Debug)] | ||
pub enum TintedBuilderError { | ||
/// Error indicating that a required property in the scheme is missing. | ||
/// | ||
/// This variant is used when a necessary property for the scheme's configuration is not found. | ||
#[error("missing scheme property: {0}")] | ||
SchemeMissingProperty(String), | ||
|
||
/// Error that occurs when YAML deserialization fails. | ||
/// | ||
/// This variant wraps the `serde_yaml::Error` and is used when there is an issue converting | ||
/// a YAML string into the corresponding Rust data structure. | ||
#[error("unable to deserialize yaml")] | ||
YamlDeserialize(#[from] serde_yaml::Error), | ||
|
||
/// Error that occurs during rendering using Ribboncurls. | ||
/// | ||
/// This variant wraps the `RibboncurlsError` and is used when an error is encountered while | ||
/// rendering a template or other content using Ribboncurls. | ||
#[error("unable to render")] | ||
RibboncurlsRender(#[from] RibboncurlsError), | ||
|
||
/// Error that occurs when a string slice cannot be converted to an integer with the given base. | ||
/// | ||
/// This variant wraps `std::num::ParseIntError` and is used when a string slice, such as a color | ||
/// value in hexadecimal format, fails to parse correctly. | ||
#[error("unable to convert string slice to integer with given base")] | ||
ColorRadix(#[from] std::num::ParseIntError), | ||
|
||
/// Error indicating that a hex color input is not formatted correctly. | ||
/// | ||
/// This variant is used when a color string that is expected to be in hex format does not match | ||
/// the expected format. | ||
#[error("hex input is not formatted correctly")] | ||
HexInputFormat, | ||
|
||
/// Error indicating that an invalid scheme variant was provided. | ||
/// | ||
/// This variant is used when an input string does not correspond to any valid scheme variant, | ||
/// such as "dark" or "light". | ||
#[error("invalid scheme variant: {0}")] | ||
InvalidSchemeVariant(String), | ||
} |
Oops, something went wrong.