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

@@ -128,9 +128,9 @@ impl SymbolInfo {
2 | 4 => Ok(2),
16 => Ok(4),
36 => Ok(6),
_ => Err(Exceptions::IllegalStateException(Some(
_ => Err(Exceptions::illegalState(
"Cannot handle this number of data regions".to_owned(),
))),
)),
}
}
@@ -140,9 +140,9 @@ impl SymbolInfo {
4 => Ok(2),
16 => Ok(4),
36 => Ok(6),
_ => Err(Exceptions::IllegalStateException(Some(
_ => Err(Exceptions::illegalState(
"Cannot handle this number of data regions".to_owned(),
))),
)),
}
}
@@ -310,9 +310,9 @@ impl<'a> SymbolInfoLookup<'a> {
}
}
if fail {
return Err(Exceptions::IllegalArgumentException(Some(format!(
return Err(Exceptions::illegalArgument(format!(
"Can't find a symbol arrangement that matches the message. Data codewords: {dataCodewords}"
))));
)));
}
Ok(None)
}