ruckusing-migrations icon indicating copy to clipboard operation
ruckusing-migrations copied to clipboard

Invalid error handler

Open woru opened this issue 12 years ago • 3 comments

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).

woru avatar Apr 22 '13 09:04 woru

Hi, Please could you provide a way to reproduce the error. Thanks

salimane avatar Apr 22 '13 10:04 salimane

By the way seems this was introduced with #95

salimane avatar Apr 22 '13 10:04 salimane

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.

woru avatar Apr 22 '13 10:04 woru