Skip to content

Commit 05613b4

Browse files
committed
Update exception types to be more specific
- Use FormatException instead of ArgumentError in crypto parsing. - Use ArgumentError instead of UnsupportedError in StsAuthClient. - Use AuthorizationCallbackException instead of Exception in AuthorizationCodeGrantServerFlow. - Add CredentialsFileException and AuthorizationCallbackException.
1 parent 1f6e9cc commit 05613b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

googleapis_auth/lib/src/crypto/pem.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ RSAPrivateKey _extractRSAKeyFromDERBytes(Uint8List bytes) {
120120
);
121121
}
122122
return privateKeyFromSequence(asn);
123+
} on FormatException {
124+
rethrow;
123125
} catch (error) {
124126
throw FormatException(
125127
'Error while extracting private key from DER bytes: $error',

0 commit comments

Comments
 (0)