static RuntimeException translateAthenaException()

in namedquery/src/main/java/software/amazon/athena/namedquery/HandlerUtils.java [20:32]


  static RuntimeException translateAthenaException(AthenaException e, String resourceIdentifier) {
    if (e instanceof InvalidRequestException) {
      if (e.getMessage() != null && e.getMessage().contains(NAMED_QUERY_NOT_FOUND)) {
        return new CfnNotFoundException(TYPE_NAME, resourceIdentifier, e);
      } else {
        return new CfnInvalidRequestException(e.getMessage(), e);
      }
    } else if (e instanceof InternalServerException) {
      return new CfnGeneralServiceException(e.getMessage(), e);
    }

    return e;
  }