/** * api_exception_handler * * Handle our ApiException interface exceptions for easy API error handling via exception throws * * @param Exception $exception The exception object instance * @access public * @return void */ public function api_exception_handler($exception) { // If we have a verbose exception if ($exception instanceof ApiVerboseException) { $more_info = $exception->getMoreInfo(); } else { $more_info = null; } // Let's handle the exception gracefully $this->abort($exception->getCode(), $exception->getSlug(), $exception->getMessage(), $more_info); }