Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
Signed-off-by: n4n5 <[email protected]>
  • Loading branch information
Its-Just-Nans authored and gabhijit committed May 29, 2024
1 parent b5ee967 commit c9b80c6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion asn-compiler/src/resolver/asn/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ pub(crate) fn resolve_value(
match typeref {
Asn1ResolvedType::Base(ref b) => match b {
ResolvedBaseType::Integer(ref _i) => {
let value = value.parse::<BaseInteger>().unwrap();
let value = match value.parse::<BaseInteger>() {
Ok(v) => v,
Err(e) => {
return Err(resolve_error!(
"resolve_value: Failed to parse Integer value: {} from {:?}",
e,
value
))
}
};
Ok(Asn1ResolvedValue::Base(ResolvedBaseValue::Integer(
Asn1ResolvedIntegerValue {
typeref: typeref.clone(),
Expand Down

0 comments on commit c9b80c6

Please sign in to comment.