Merge "Don't re-wrap DeviceIdAttestationExceptions" am: 27bc799e7e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1698089

Change-Id: Iee544cafa0cba275bb151cd99b431af00389ffb6
This commit is contained in:
Seth Moore
2021-05-07 02:40:27 +00:00
committed by Automerger Merge Worker

View File

@ -293,6 +293,11 @@ public abstract class AttestationUtils {
} catch (SecurityException e) {
throw e;
} catch (Exception e) {
// If a DeviceIdAttestationException was previously wrapped with some other type,
// let's throw the original exception instead of wrapping it yet again.
if (e.getCause() instanceof DeviceIdAttestationException) {
throw (DeviceIdAttestationException) e.getCause();
}
throw new DeviceIdAttestationException("Unable to perform attestation", e);
}
}