public function set_error($message, $halt = false)
    {
        if ($message instanceof Exception) {
            $message = $message->getMessage();
        }

        $this->_errors[] = $message;
        log_message('error', $message);

        if ($halt) {
            show_error($message);
        }
    }