refactor to use exception helper factories

This commit is contained in:
Vukašin Stepanović
2023-02-15 10:46:13 +00:00
parent 3e27279dc8
commit 722ce78fd0
132 changed files with 966 additions and 1132 deletions

View File

@@ -166,9 +166,9 @@ impl PlanarYUVLuminanceSource {
inverted: bool,
) -> Result<Self, Exceptions> {
if left + width > data_width || top + height > data_height {
return Err(Exceptions::IllegalArgumentException(Some(
return Err(Exceptions::illegalArgument(
"Crop rectangle does not fit within image data.".to_owned(),
)));
));
}
let mut new_s: Self = Self {
@@ -328,7 +328,7 @@ impl LuminanceSource for PlanarYUVLuminanceSource {
self.invert,
) {
Ok(new) => Ok(Box::new(new)),
Err(_err) => Err(Exceptions::UnsupportedOperationException(None)),
Err(_err) => Err(Exceptions::unsupportedOperationEmpty()),
}
}