Skip to content

Commit

Permalink
feat: Add error description
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Apr 18, 2024
1 parent d60b442 commit 9f54665
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,13 @@ MessageHandler getMessageHandler(dynamic e) {
'error_description': 'The credential support format has some issues.',
},
);
} else if (stringException == 'AUTHORIZATION_DETAIL_ERROR') {
return ResponseMessage(
data: {
'error': 'unsupported_format',
'error_description': 'Invalid token response format.',
},
);
} else {
return ResponseMessage(
message:
Expand Down
4 changes: 3 additions & 1 deletion packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ class OIDC4VC {
)
.firstOrNull;

if (authDetailForCredential == null) throw Exception();
if (authDetailForCredential == null) {
throw Exception('AUTHORIZATION_DETAIL_ERROR');
}

final credentialIdentifiers =
(authDetailForCredential['credential_identifiers'] as List<dynamic>)
Expand Down

0 comments on commit 9f54665

Please sign in to comment.