public function error($code, $message, $extra = [])
    {
        $response['success'] = false;
        $this->extra($extra);
        if (!in_array($code, array_keys($this->errors))) {
            $code = 500;
        }
        $response['error']['code'] = $code;
        $this->header($this->errors[$code]);
        $response['error']['status'] = $this->errors[$code];
        $response['error']['message'] = $message;
        return $this->output($response);
    }