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:
@@ -53,7 +53,7 @@ impl<'a> MultiDetector<'_> {
|
||||
let infos = finder.findMulti(hints)?;
|
||||
|
||||
if infos.is_empty() {
|
||||
return Err(Exceptions::NotFoundException(None));
|
||||
return Err(Exceptions::notFoundEmpty());
|
||||
}
|
||||
|
||||
let mut result = Vec::new();
|
||||
|
||||
@@ -93,9 +93,9 @@ impl<'a> MultiFinderPatternFinder<'_> {
|
||||
|
||||
if size < 3 {
|
||||
// Couldn't find enough finder patterns
|
||||
return Err(Exceptions::NotFoundException(Some(
|
||||
return Err(Exceptions::notFound(
|
||||
"Couldn't find enough finder patterns".to_owned(),
|
||||
)));
|
||||
));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -212,7 +212,7 @@ impl<'a> MultiFinderPatternFinder<'_> {
|
||||
if !results.is_empty() {
|
||||
Ok(results)
|
||||
} else {
|
||||
Err(Exceptions::NotFoundException(None))
|
||||
Err(Exceptions::notFoundEmpty())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ impl MultipleBarcodeReader for QRCodeMultiReader {
|
||||
// ignore and continue
|
||||
continue;
|
||||
} else {
|
||||
return Err(output.err().unwrap_or(Exceptions::NotFoundException(None)));
|
||||
return Err(output.err().unwrap_or(Exceptions::notFoundEmpty()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user