Last active
December 19, 2015 20:09
-
-
Save bkrall/6011848 to your computer and use it in GitHub Desktop.
No exception object returned by a failed call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _modulename_getData($field, $table) { | |
try { | |
if (empty($field)) { | |
throw new Exception("The field is undefined."); | |
} | |
// rest of code here... | |
} | |
catch (Exception $e) { | |
/* | |
Here you can either echo the exception message like: | |
echo $e->getMessage(); | |
Or you can throw the Exception Object $e like: | |
throw $e; | |
*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment