New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging invalid java migration file #2482
Comments
@cdalexndr Thanks for reporting this. Just to clarify the behaviour you expected to see: would you like the command (such as Migrate) to fail with the exception that is thrown inside the constructor of the Java migration? |
@alextercete Yes, that would be nice. |
@cdalexndr Upon closer inspection, it looks like Flyway 6 is already adding the root cause of the invocation target exception to the debug message, so it might be just the case of promoting that to a warning or an error. Could you please confirm that Flyway 6 in debug mode gives you the actual exception being thrown inside the constructor of your migration? |
We've decided to show that message as a warning. As of Flyway 6, it will also contain the root cause of the exception. |
Using 'info' level logger, my java migration script is skipped, and no error is logged (what happened?!).
With 'debug' log level i get:
Skipping non-instantiable class (invocation error): db.migration.V0_1_0__java_migration
Actually, the constructor of my java migration script throws an exception, and
ClassUtils
catchesInvocationTargetException
and logs a debug mesage with no exception stack trace or message, thus the reason is missing.I understand the reason to silently skip non java migration scripts inside 'db/migrations', but if the java class has the required name template (is a migration class) then any exceptions inside it should be logged as error/warn.
The text was updated successfully, but these errors were encountered: