How to skip failed changesets but display them with the error message in a log / output?

Hello,
I am trying to implement MS SQL database update scenario with Liquibase 4.16.1, running it in Teamcity agent.
I use “Update” command and have a root .xml file with a lot of .sql changelog files in several folders.
Developers update some .sql files and sometimes create new ones.

Usually, when an error occures in .sql file the whole run of update fails at the bad .sql file.
I would like to skip bad file and continue with other files, displaying failed files with error message in a log or regular output, as it does in a regulag run (perhaps with a shorter message, if possible).
When I use “failOnError” changeset option it silently skipps the bad file but does not display any error.
It is possible to check updated files in DATABASECHANGELOG table or run a status command, but would be great to display errors during “update” run.

Any ideas?

2 Likes

I have found answer to my question:
in changeset I set
failOnError:false
In command-line arguments I specify --log-level:
–log-level:‘INFO’

Perhaps my question was not clear enough, but I expected to get errors/exceptions at error or at least warning levels so that it would be easier to distinguish failed and successful changesets / changelogs.
Anyway this solution works for me. I added an extra step in CI/CD to get status of changelogs and then I copy those failed changelogs to email message to provide feedback in case of failures.

1 Like

Hey @bvikhanskiy - thanks for following up with the solution! That’s a really helpful contribution to the community, and we appreciate it! :slight_smile:

Cheers,
Tabby
Liquibase Technical Community Manager