Skip to content

Instantly share code, notes, and snippets.

@teepluss
Created June 6, 2014 16:49
Show Gist options
  • Save teepluss/33cffc2c5fba8673ff8e to your computer and use it in GitHub Desktop.
Save teepluss/33cffc2c5fba8673ff8e to your computer and use it in GitHub Desktop.
try{
// ...
}
catch( Exception $e )
{
if ($e instanceof UserNotFoundException) {
// it's an instance of UserNotFoundException, return accordingly
}
elseif ($e instanceof SomethinElseException) {
// it's an instance of SomethinElseException, return accordingly
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment