ruckusing-migrations
ruckusing-migrations copied to clipboard
Invalid error handler
ErrorHandler (Ruckusing_Exception.php:79) cannot call exit(1) for warnings.
E.g. when pg_query fails not only it sets error code but also it generates a warning. Currently errorHandler calls exit(1) on warnings and db errors are not handled properly (e.g. migration that failed is not shown).
Hi, Please could you provide a way to reproduce the error. Thanks
By the way seems this was introduced with #95
Yes, it was introduced with #95.
steps:
- env: postgres db, PHP 5.4.6-1ubuntu1.2
- create a migration
- in the up method add an invalid sql e.g. $this->execute("drop table dssdsdsdsd");
- run migrations
Migration fails and there's a message: pg_query(): Query failed: ERROR: table "dssdsdsdsd" does not exist but there's no info which migration failed.
Maybe we need exit(1) only in exception handler or we can add a check in errorHandler so that it doesn't call exit(1) for E_WARNING error code.