' . $exception->getMessage() . '
' . $exception->getTraceAsString() . '
'; } /** * Get a javascript object of a given exception. * * This method is pretty useful whenever we need to pass an exception object * to javascript during ajax calls. * * @param Exception $exception The given exception object. * @return string Returns the json encoded object of the exception. */ function exceptionToJavascript($exception) { return json_encode(array( 'code' => $exception->getCode(), 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'message' => $exception->getMessage(), 'previous' => $exception->getPrevious(), 'trace' => $exception->getTraceAsString() )); } /* End of file exception_types_helper.php */ /* Location: ./application/helpers/exception_types_helper.php */