-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added error and result types, removed a lot of unwraps, expects and panics, but there are still some left in the tarsila crate, especially in GUI code.
- Loading branch information
Showing
16 changed files
with
256 additions
and
132 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use thiserror::Error; | ||
|
||
pub type Result<T> = std::result::Result<T, Error>; | ||
|
||
#[derive(Debug, Error)] | ||
pub enum Error { | ||
#[error("Failed to generate image from raw data")] | ||
FailedImageFromRaw, | ||
#[error("No free image found")] | ||
MissingFreeImage, | ||
#[error("Unsupported image format")] | ||
UnsupportedImageFormat, | ||
#[error("Drawing action has not started")] | ||
DrawingNotStarted, | ||
#[error("Image error: {0}")] | ||
ImageError(#[from] image::ImageError), | ||
#[error("IO error: {0}")] | ||
IoError(#[from] std::io::Error), | ||
#[error("Bug: reversal list is not set")] | ||
ReversalNotSet, | ||
#[error("Codec error: {0}")] | ||
CodecError(#[from] bincode::Error), | ||
} |
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
Oops, something went wrong.