function process_exception($object) { // load language specific strings which can be used in error files Znap::load_strings(); $this->error = $object; $this->message = $object->getMessage(); $this->details = $object->getDetails(); $this->code = $object->getCode(); $this->trace = $object->getTrace(); if ($this->code != 0) { header('Status: ' . $this->code); } $ZNAP_ENV = Znap::$use_development_errors ? 'development' : ZNAP_ENV; $paths = array(Znap::$errors_path . '/' . $ZNAP_ENV, Znap::$errors_default_path, ZNAP_LIB_ROOT . '/znap_error/' . $ZNAP_ENV, ZNAP_LIB_ROOT . '/znap_error/default'); foreach ($paths as $path) { if (is_file($path . '/' . $this->code . '.' . Znap::$views_extension)) { $view_file = $path . '/' . $this->code . '.' . Znap::$views_extension; break; } elseif (is_file($path . '/default.' . Znap::$views_extension)) { $view_file = $path . '/default.' . Znap::$views_extension; break; } } $this->render_file($view_file); }