public static Response map(SQLException sqlEx)
  {
    if (null != sqlEx.getSQLState())
    {
      switch (sqlEx.getSQLState())
      {
        //query_canceled
        case "57014":
          return Response.status(504).entity(sqlEx.getMessage()).build();
        case "2201B":
          // regular expression did not compile
          AqlParseError error = new AqlParseError(sqlEx.getMessage());
          return Response.status(Response.Status.BAD_REQUEST).entity(
            new GenericEntity<List<AqlParseError>>(Arrays.asList(error))
            {
            })
            .type("application/xml").build();
      }
    }
    return null;
  }
public static Response map ( SQLException sqlEx ) { if ( null != sqlEx . getSQLState ( ) ) { switch ( sqlEx . getSQLState ( ) ) { case "57014" : return Response . status ( 504 ) . entity ( sqlEx . getMessage ( ) ) . build ( ) ; case "2201B" : AqlParseError error = new AqlParseError ( sqlEx . getMessage ( ) ) ; return Response . status ( Response . Status . BAD_REQUEST ) . entity ( new GenericEntity < List < AqlParseError > > ( Arrays . asList ( error ) ) { } ) . type ( "application/xml" ) . build ( ) ; } } return null ; }
Maps an exception to a response or returns null if it wasn't handled
@param sqlEx
@return