mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
use ImageError
instead of string
- https://github.com/denoland/deno/pull/25517#discussion_r1861402027
This commit is contained in:
parent
40cee983a3
commit
7039401fbe
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ pub enum CanvasError {
|
|||
UnsupportedColorType(ColorType),
|
||||
/// This error will be mapped to DOMExceptionInvalidStateError.
|
||||
#[error("Cannot decode image '{0}'")]
|
||||
InvalidImage(String),
|
||||
InvalidImage(image::ImageError),
|
||||
/// This error will be mapped to DOMExceptionInvalidStateError.
|
||||
#[error("The chunk data is not big enough with the specified width: {0} and height: {1}.")]
|
||||
NotBigEnoughChunk(u32, u32),
|
||||
|
@ -37,7 +37,7 @@ pub enum CanvasError {
|
|||
impl CanvasError {
|
||||
/// Convert an [`image::ImageError`] to an [`CanvasError::InvalidImage`].
|
||||
fn image_error_to_invalid_image(error: image::ImageError) -> Self {
|
||||
Self::InvalidImage(error.to_string())
|
||||
CanvasError::InvalidImage(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue