protected static function errors($exception, $module, $partial_response = null) { // In the handlers below, you can get errors with: // $errors = Pie_Response::getErrors(); try { if (self::$handling_errors) { // We need to handle errors, but we // have already tried to do it. // Just show the errors view. echo Pie::view('pie/errors.php', compact('errors')); return; } self::$handling_errors = true; if (Pie::canHandle("{$module}/errors")) { Pie::event("{$module}/errors", compact('errors', 'exception', 'partial_response')); } else { Pie::event("pie/errors", compact('errors', 'exception', 'partial_response')); } } catch (Exception $e) { Pie::event('pie/exception', array('exception' => $e)); } }