Rules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.
Each error override has the following format: STATE:12345:W
. It is a 5 character SQL state (or *
to match all SQL states), a colon, the SQL error code (or *
to match all SQL error codes), a colon and finally the desired behavior that should override the initial one.
The following behaviors are accepted:
D
to force a debug messageD-
to force a debug message, but do not show the original sql state and error codeD+
to force a debug message, but only show the original sql state and error codeI
to force an info messageI-
to force an info message, but do not show the original sql state and error codeI+
to force an info message, but only show the original sql state and error codeW
to force a warningW-
to force a warning, but do not show the original sql state and error codeW+
to force a warning, but only show the original sql state and error codeE
to force an errorE-
to force an error, but do not show the original sql state and error codeE+
to force an error, but only show the original sql state and error codeExample 1: to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used: 99999:17110:E
Example 2: to force SQL Server PRINT messages to be displayed as info messages (without SQL state and error code details) instead of warnings, the following errorOverride can be used: S0001:0:I-
Example 3: to force all errors with SQL error code 123 to be treated as warnings instead, the following errorOverride can be used: *:123:W
Example 4: Use this errorOverride to raise an error for any error or warning, showing only the SQL state and error code without the rest of the message (this is useful for cases where the full error message contains a large SQL statement which would take up the entire commandline output): \*:\*:E+
See errorOverrides for more details.
./flyway -errorOverrides="STATE:12345:W" clean
flyway.errorOverrides=STATE:12345:W
FLYWAY_ERROR_OVERRIDES=STATE:12345:W
Flyway.configure()
.errorOverrides("STATE:12345:W")
.load()
flyway {
errorOverrides = 'STATE:12345:W'
}
<configuration>
<errorOverrides>STATE:12345:W</errorOverrides>
</configuration>
See our error overrides examples.