Search in sources :

Example 1 with AzureOperationException

use of com.microsoft.azure.toolkit.lib.common.operation.AzureOperationException in project azure-maven-plugins by microsoft.

the class AzureMessage method getRecognizableCause.

@Nullable
private static Throwable getRecognizableCause(@Nonnull Throwable throwable) {
    final List<Throwable> throwables = ExceptionUtils.getThrowableList(throwable);
    for (int i = throwables.size() - 1; i >= 0; i--) {
        final Throwable t = throwables.get(i);
        if (t instanceof AzureOperationException) {
            continue;
        }
        final String rootClassName = t.getClass().getName();
        if (rootClassName.startsWith("com.microsoft") || rootClassName.startsWith("com.azure")) {
            return t;
        }
    }
    return null;
}
Also used : AzureOperationException(com.microsoft.azure.toolkit.lib.common.operation.AzureOperationException) AzureString(com.microsoft.azure.toolkit.lib.common.bundle.AzureString) Nullable(javax.annotation.Nullable)

Aggregations

AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 AzureOperationException (com.microsoft.azure.toolkit.lib.common.operation.AzureOperationException)1 Nullable (javax.annotation.Nullable)1