Class BeanQueryExecutionException

All Implemented Interfaces:
Serializable

A server-side failure while running a valid BeanQuery: a SQLException, a connection failure, or a column accessor that throws.

Contrast with BeanQuerySyntaxException, which reports bad caller input (HTTP 400). This exception maps to HTTP 500. Its message is deliberately generic (for example "Query execution failed for table 'person'."); the underlying cause is attached, and engines log any SQL text instead of putting it in the message.

Example:

try (SqlBeanQuerySession<Person> session = context.getSession()) { return session.find(query); } catch (BeanQuerySyntaxException e) { throw new BadRequest(e.getMessage()); // The caller's fault. } catch (BeanQueryExecutionException e) { throw new InternalServerError(e, "Search failed."); // Ours. }

Since:
10.0.0
See Also:
  • Constructor Details

    • BeanQueryExecutionException

      public BeanQueryExecutionException(Throwable cause, String message, Object... args)
      Constructor.
      Parameters:
      cause - The underlying failure. Can be null.
      message - The printf-style message.
      args - The message arguments.