|
} catch (error) { |
|
if (error instanceof secureEnvironment.KeyNotFoundError) { |
|
throw new Kms.KeyManagementKeyNotFoundError(options.keyId, [this.backend]) |
|
} |
|
|
|
throw new Kms.KeyManagementError('Error signing with key', { cause: error }) |
|
} |
|
} |
Currently just generic KMS error thrown. We should create like a Kms.AuthenticationCanceledError, and a Kms.BiometryDisabledError (or something more generic than biometrics, but indicating the authentication method is not available, like AuthenticationNotAvailable).
Should probably be addressed in expo-secure-environment to throw proper errors there, which can be caught in Credo KMS for react native, and then re-emitted as Credo errors
credo-ts/packages/react-native/src/kms/SecureEnvironmentKeyManagementService.ts
Lines 125 to 132 in b5469dd
Currently just generic KMS error thrown. We should create like a Kms.AuthenticationCanceledError, and a Kms.BiometryDisabledError (or something more generic than biometrics, but indicating the authentication method is not available, like AuthenticationNotAvailable).
Should probably be addressed in expo-secure-environment to throw proper errors there, which can be caught in Credo KMS for react native, and then re-emitted as Credo errors