static RuntimeException handleExceptions()

in datacatalog/src/main/java/software/amazon/athena/datacatalog/HandlerUtils.java [29:40]


  static RuntimeException handleExceptions(AthenaException e, String identifier) {
    if (e instanceof InvalidRequestException && e.getMessage()!= null &&
        e.getMessage().contains("has already been created")) {
      return new CfnAlreadyExistsException(e);
    }  else if ((e instanceof InvalidRequestException && e.getMessage()!= null &&
        e.getMessage().contains("was not found"))
        || e instanceof ResourceNotFoundException) {
      return new CfnNotFoundException(RESOURCE_TYPE, identifier, e);
    } else {
      return e;
    }
  }