Answers for "laravel manually throw exception"

PHP
2

throwexception laravel

throw new \ErrorException('Error found');
Posted by: Guest on July-30-2021
0

laravel throw exception with status code

try {
    throw new Exception("Some error message", 30);
  //here 30 is the custom code
} catch(Exception $e) {
    echo "The exception code is: " . $e->getCode();
}
Posted by: Guest on February-09-2022

Code answers related to "laravel manually throw exception"

Browse Popular Code Answers by Language