php - Why does this exception propagate all the way to App::fatal? -
in snippet problem i'm saving $model null (thanks @lucas brito).
don't understand is:
- why exception isn't caught in try/catch around $model->save()
- why $exception variable in app::fatal empty
- how show more explicit error
every time call $model->save();
$new = new system(); $new->imcid = $imcid; $new->name = $name; $new->validate(); log::info('at update'); try{ $model->save(); }catch(\exception $e){ log::info('exception thrown'); } log::info('done'); in log can see 'at update' not 'exception thrown' or 'done'.
message defined on routes.php
app::fatal(function($exception){ return response::json(array( 'message' => 'damn...', 'exception' => $exception ), 500); });
i think you're trying save wrong variable. shouldn't save $new?
here's how do:
$reg = new area; $reg->name = $name; $reg->created_at = time(); $reg->created_by = auth::user()->id; $reg->save();
Comments
Post a Comment