function exceptionHandlerForAPI(Exception $exception) { $bt = $exception->getTrace(); array_unshift($bt, array('line' => $exception->getLine(), 'file' => $exception->getFile())); Kurogo::log(LOG_ALERT, "A " . get_class($exception) . " has occured: " . $exception->getMessage(), "exception", $bt); $error = KurogoError::errorFromException($exception); $response = new APIResponse(); $response->setVersion(0); $response->setError($error); $response->display(); exit; }
function exceptionHandlerForAPI($exception) { $error = KurogoError::errorFromException($exception); $response = new APIResponse(); $response->setVersion(0); $response->setError($error); $response->display(); }