Skip to content

Commit

Permalink
refactor(operations): updated error type
Browse files Browse the repository at this point in the history
  • Loading branch information
SalOne22 committed Aug 23, 2024
1 parent ca2a00e commit 6957669
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/operations/resize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ impl OperationsTrait for Resize {
let (src_width, src_height) = image.dimensions();
let (dst_width, dst_height) = self.new_dimensions;
if (dst_height == 0) || (dst_width == 0) {
return Err(ImageErrors::GenericStr("Error for 0 as Height or Width."));
return Err(ImageErrors::OperationsError(
ImageOperationsErrors::Generic("Width or Height cannot be 0"),
));
}

let depth = image.depth().bit_type();
Expand Down

0 comments on commit 6957669

Please sign in to comment.