File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,15 @@ Future<AutoRefreshingAuthClient> fromApplicationsCredentialsFile(
2727 Object ? credentials;
2828 try {
2929 credentials = json.decode (await file.readAsString ());
30- } on IOException {
30+ } on IOException catch (e) {
3131 throw CredentialsFileException (
3232 'Failed to read credentials file from $fileSource ' ,
33+ e,
3334 );
34- } on FormatException {
35+ } on FormatException catch (e) {
3536 throw CredentialsFileException (
3637 'Failed to parse JSON from credentials file from $fileSource ' ,
38+ e,
3739 );
3840 }
3941
Original file line number Diff line number Diff line change @@ -60,11 +60,15 @@ class ServerRequestFailedException implements Exception {
6060/// Thrown when an error occurs reading or parsing a credentials file.
6161class CredentialsFileException implements Exception {
6262 final String message;
63+ final Object ? innerError;
6364
64- const CredentialsFileException (this .message);
65+ const CredentialsFileException (this .message, [ this .innerError] );
6566
6667 @override
67- String toString () => 'CredentialsFileException: $message ' ;
68+ String toString () => [
69+ 'CredentialsFileException: $message ' ,
70+ if (innerError != null ) '($innerError )' ,
71+ ].join (' ' );
6872}
6973
7074/// Thrown when the oauth2 callback request from the authorization server is
You can’t perform that action at this time.
0 commit comments