christamcc
asked on
PHP How to show error message in "catch"
I have something like this:
And calling code:
How do I print the error upon die?
thanks!
function doThis() {
Try {
//lots of stuff
return $thething;
} catch (SpecialException Exception $ex) {
die($ex->getMessage());
}
};
And calling code:
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$theThing = doThis();
//do stuff with $theThing;
}
How do I print the error upon die?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://php.net/manual/en/language.exceptions.php