Skip to content

Commit

Permalink
align error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Hajime-san committed Nov 28, 2024
1 parent 7039401 commit 4cca9ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ext/canvas/01_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function createImageBitmap(
new DOMException(
`${prefix}: The provided value for 'image' is not of type '(${
ArrayPrototypeJoin(imageBitmapSources, " or ")
})'.`,
})'`,
"InvalidStateError",
),
);
Expand Down Expand Up @@ -267,14 +267,14 @@ function createImageBitmap(
} else if (mimeTypeString === "") {
return PromiseReject(
new DOMException(
`The MIME type of source image is not specified.`,
`The MIME type of source image is not specified`,
"InvalidStateError",
),
);
} else {
return PromiseReject(
new DOMException(
`The MIME type ${mimeTypeString} of source image is not a supported format.`,
`The MIME type ${mimeTypeString} of source image is not a supported format`,
"InvalidStateError",
),
);
Expand Down
4 changes: 2 additions & 2 deletions ext/canvas/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ pub enum CanvasError {
#[error("Cannot decode image '{0}'")]
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}.")]
#[error("The chunk data is not big enough with the specified width: {0} and height: {1}")]
NotBigEnoughChunk(u32, u32),
/// This error will be mapped to DOMExceptionInvalidStateError.
#[error("The width: {0} or height: {1} could not be zero.")]
#[error("The width: {0} or height: {1} could not be zero")]
InvalidSizeZero(u32, u32),
/// This error will be mapped to TypeError.
#[error(transparent)]
Expand Down

0 comments on commit 4cca9ae

Please sign in to comment.