The jOOQ User Manual : Code generation : Advanced generator configuration : Error handling | previous : next |
This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Error handling
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
This optional top level configuration element allows configuring the action to be taken by the generator in case of unexpected exceptions encountered during the code generation.
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.16.5.xsd"> <!-- Behaviour when encountering an exception. Defaults to FAIL --> <onError>FAIL</onError> <!-- Behaviour when encountering an unused configuration element. Defaults to LOG --> <onUnused>LOG</onUnused> </configuration>
new org.jooq.meta.jaxb.Configuration() // Behaviour when encountering an exception. Defaults to FAIL .withOnError(OnError.FAIL) // Behaviour when encountering an unused configuration element. Defaults to LOG .withOnUnused(OnError.LOG)
myConfigurationName(sourceSets.main) { // Behaviour when encountering an exception. Defaults to FAIL onError = 'FAIL' // Behaviour when encountering an unused configuration element. Defaults to LOG onUnused = 'LOG' }
The available error actions are:
-
FAIL
- The exception will be thrown and handled by the caller (e.g. Maven) -
LOG
- The exception will be handled by the generator by logging it as a warning -
SILENT
- The exception will be silently ignored by the generator
Feedback
Do you have any feedback about this page? We'd love to hear it!