public static String getAwsErrorMessage()

in aws-core-common/src/main/java/jetbrains/buildServer/clouds/amazon/connector/utils/AwsExceptionUtils.java [12:36]


  public static String getAwsErrorMessage(@NotNull final Throwable exception){
    Throwable cause = exception.getCause();

    if (isAmazonServiceException(exception)) {
      AwsServiceException awsServiceException = (AwsServiceException) exception;
      AwsErrorDetails details = awsServiceException.awsErrorDetails();

      if (details == null) {
        return exception.toString();
      }

      return awsServiceException.getMessage();
    } else if (isAmazonServiceException(cause)) {
      AwsServiceException awsServiceException = (AwsServiceException) cause;
      AwsErrorDetails details = awsServiceException.awsErrorDetails();

      if (details == null) {
        return cause.toString();
      }

      return awsServiceException.getMessage();
    } else {
      return exception.getMessage();
    }
  }