try {
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
throw new \ErrorException('some message');
}
//some code
} catch(Exception $e)
{
echo $e->getMessage();
}
try {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
throw new \ErrorException('some message');
}
//some code
} catch(\Exception $e) {
echo $e->getMessage();
}