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
Would be great clean up the controllers and move the extra logical code to repositories or models.
I realized that when a problem occurs with the DB::transaction, the controllers are not firing the exception, but only returning a error message. It is very difficult to track the errors occurred when saving or updating data.
Ex:
DB::beginTransaction();
try {
...
} catch (\Exception$e) {
DB::rollback();
// I think here we can throw an exception, with the message below. Then, on the// exceptions handler, we check if the system env is dev or production, to show the error// or only flash the message. flash()->error('Error while creating the member');
returnredirect(action('MembersController@index'));
}
The text was updated successfully, but these errors were encountered:
Would be great clean up the controllers and move the extra logical code to repositories or models.
I realized that when a problem occurs with the DB::transaction, the controllers are not firing the exception, but only returning a error message. It is very difficult to track the errors occurred when saving or updating data.
Ex:
The text was updated successfully, but these errors were encountered: