Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upLogging invalid java migration file #2482
Comments
This comment has been minimized.
This comment has been minimized.
@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? |
This comment has been minimized.
This comment has been minimized.
@alextercete Yes, that would be nice. |
This comment has been minimized.
This comment has been minimized.
@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? |
This comment has been minimized.
This comment has been minimized.
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.