Skip to content

Commit

Permalink
wrapping in a try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
blackgirlbytes committed Feb 7, 2024
1 parent c246a35 commit e768ab5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Here's how the verifier can create the presentation definition, and validate tha
language: 'JavaScript',
},
{
content: 'This returns an undefined result, but if unsuccessful, it will throw an error.',
content: 'If the validation is unsuccessful, `validateDefinition()` will throw an error.',
language: 'Kotlin',
}
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ internal class FanClubVcTest {
)
)
)

val definitionValidation = PresentationExchange.validateDefinition(presentationDefinition)
try {
PresentationExchange.validateDefinition(presentationDefinition)
println("Presentation Definition is valid!")
} catch (err: Exception) {
println("Presentation Definition is not valid: " + err.message)
}
// :snippet-end:
assertDoesNotThrow {PresentationExchange.validateDefinition(presentationDefinition)}
}
Expand Down

0 comments on commit e768ab5

Please sign in to comment.