public function get_reason() {
        if (empty($this->reason)) {
            $this->reason = $this->responsecodes[$this->code];
        }
        // Use generic reason for this category (based on first digit) if a specific reason is not defined.
        if (empty($this->reason)) {
            $this->reason = $this->responsecodes[intval($this->code / 100) * 100];
        }
        return $this->reason;
    }