Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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();
}
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #laravel #throw #exception #status #code
ADD COMMENT
Topic
Name
4+4 =