$error = JError::getError(); echo "Error code: " . $error->code; echo "Error message: " . $error->message; echo "Error level: " . $error->level; echo "Error stack: "; var_dump($error->stack);
if ($error = JError::getError()) { // An error occurred, handle it switch ($error->level) { case 'notice': // Handle notice error break; case 'warning': // Handle warning error break; case 'error': // Handle non-fatal error break; case 'fatal': // Handle fatal error break; } }These examples use the JError class from the Joomla framework.