dimanche 26 juin 2016

Issue when trying to show exception: Laravel 5.2.37

I have below code

try {
    $Role = $this->Get($obj->RoleID);
    if($Role == null) {
        return trans('Role.RoleNotFound');
    }
    $Role->Role = $obj->Role;
    $Role->save();
} catch (Exception $ex) {
    dd($ex);
    return $ex;
}

I am passing below data to this function

{#157 ▼
  +"Role": "wsedde"
  +"RoleID": "31"
}

What's the problem?

As per the schema Role column has length = 2 and I by mistake passed length greater then 2. I have try catch applied but exception is not showing.

Can you tell why it does not go inside catch block?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire