mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
refactor to use exception helper factories
This commit is contained in:
@@ -127,7 +127,7 @@ impl LuminanceSource for RGBLuminanceSource {
|
||||
height,
|
||||
) {
|
||||
Ok(crop) => Ok(Box::new(crop)),
|
||||
Err(_error) => Err(Exceptions::UnsupportedOperationException(None)),
|
||||
Err(_error) => Err(Exceptions::unsupportedOperationEmpty()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,9 +179,9 @@ impl RGBLuminanceSource {
|
||||
height: usize,
|
||||
) -> 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(),
|
||||
)));
|
||||
));
|
||||
}
|
||||
Ok(Self {
|
||||
luminances: pixels.to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user