Skip to content

2.4.2

Latest

Choose a tag to compare

@rainbowdashlabs rainbowdashlabs released this 07 Nov 14:52
v2.4.2
225cfd9

SADU 2.4.2

Rows that cannot be mapped now reach your exception handler like every other query error.

Before updating

  • Behaviour change: with setThrowExceptions(false) (the default), a read whose rows cannot be mapped no longer throws MappingException at the caller. It returns an empty result, and the error goes to the exception handler and the result's exceptions. Code that caught MappingException around a query will not see it any more.

Bugfixes

  • MappingException skipped the exception handler: errors from mapAs and map are passed to the handler set with setExceptionHandler, follow setThrowExceptions and show up in hasExceptions() and exceptions() of the result.

Improvements

  • Dependencies: sqlite-jdbc 3.54.1.0 and jspecify 1.0.1.

Developer notes

  • The handler receives a QueryException whose getCause() is the MappingException, and whose message contains the SQL of the query. Check the cause to tell mapping errors apart from database errors.
  • With setThrowExceptions(true), the error is thrown as WrappedQueryExecutionException, with the QueryException as its cause.
  • QueryException passes SQL state and error code to SQLException. getSQLState() and getErrorCode() return the same values as before for database errors and null and 0 for mapping errors.