mardi 1 mars 2022

How to print custom message in try catch - php laravel

I need to write to log some data when exception occurred, since it is dynamic data and I need the message I tried with simple code, just to write 'Boom' if exception occurred. However just the automatic exception data written in logs (as before the try catch). can someone advise how to print to log in the catch?

try {
    $sheet->setCellValue($cell,$innervalue);
} catch(Exception $e) {
    $message = 'Can not set value: '.$innervalue .' in cell ' .$cell .$headerArray[$headerIndex];
    \Log::info('boom');
}

and in the logs nothing displayed enter image description here



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/u3JOlA6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire