public function add($message, $code, $type)
    {
        $default = ['message' => $message, 'code' => $code, 'type' => $type];
        if ($type == 'error' && is_numeric($code) && $code >= 0) {
            $default['descriptor'] = array_search($code, $this->codes['codes']);
        }
        if ($this->domain !== self::DEFAULT_DOMAIN) {
            $default['domain'] = $this->domain;
        }
        array_push($this->messages, $default);
        return $this;
    }