I've got a plugin migration that returns
false from its
safeUp() method when certain conditions aren't met.
false from the migration, the update stalls, rolls back changes and gives an error screen with a generic error message – i.e. "There was a problem updating your database".
For many users (i.e. those who aren't tech savvy enough to check logs etc.) this message isn't very helpful at all. Is it possible to add a custom message when a migration is aborted?
I've tried throwing an exception inside
safeUp(), which gets logged but does not display on the error screen.
If I use a
die() statement for the error message, Craft does display it on the error screen, but that makes the whole update process halt, which seems like an unsafe thing to do.
I've also attempted to use
craft()->userSession->setError(), but that doesn't appear to be working, either.