You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling save() on a model object, it hints that it returns true or false whether save succeeded. It does not hint any exceptions are thrown, however it calls insert() or update() which can throw db\Exception or Throwable.
So when the database configuration is wrong or database is not responsing then an Exception is thrown from save() and causes an unexpected error.
Either:
a) the exceptions should be caught within save(), logged and returns false
b) PHP doc for save() needs to be updated with [at]throws statement, so IDE's can detect it needs exception handling
The text was updated successfully, but these errors were encountered:
When calling save() on a model object, it hints that it returns true or false whether save succeeded. It does not hint any exceptions are thrown, however it calls insert() or update() which can throw db\Exception or Throwable.
So when the database configuration is wrong or database is not responsing then an Exception is thrown from save() and causes an unexpected error.
Either:
a) the exceptions should be caught within save(), logged and returns false
b) PHP doc for save() needs to be updated with [at]throws statement, so IDE's can detect it needs exception handling
The text was updated successfully, but these errors were encountered: