Merge "Don't re-wrap DeviceIdAttestationExceptions" am: 27bc799e7e am: 02359c00d6 am: 85d779c4a4

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

Change-Id: I9aefcc9b3b93a37437885d7e6fb1a8d9734b3dd1
This commit is contained in:
Seth Moore 2021-05-07 03:37:24 +00:00 committed by Automerger Merge Worker
commit 7ac158fda8

View File

@ -260,6 +260,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);
}
}