1<?php
2
3namespace dokuwiki\plugin\oauth;
4
5use OAuth\Common\Http\Exception\TokenResponseException;
6
7/**
8 * Exception relating to http token response from service.
9 */
10class HttpTokenResponseException extends TokenResponseException
11{
12    protected $httpStatusCode = 0;
13    protected $httpErrorMessage = "";
14    protected $httpRespBody = "";
15
16    /**
17     * @param string $message
18     * @param int $httpStatusCode
19     * @param string httpErrorMessage
20     * @param mixed httpRespBody
21     * @param int $code
22     * @param \Throwable|null $previous
23     */
24    public function __construct(
25        $message = "",
26        $httpStatusCode = 0,
27        $httpErrorMessage = "",
28        $httpRespBody = "",
29        $code = 0,
30        \Throwable $previous = null
31    ) {
32        parent::__construct($message, $code, $previous);
33        $this->httpStatusCode = $httpStatusCode;
34        $this->httpErrorMessage = $httpErrorMessage;
35        $this->httpRespBody = $httpRespBody;
36    }
37
38    /**
39     * Get the HTTP status code
40     *
41     * @return int
42     */
43    public function getHttpStatusCode()
44    {
45        return $this->httpStatusCode;
46    }
47
48    /**
49     * Get the HTTP error message
50     *
51     * @return string
52     */
53    public function getHttpErrorMessage()
54    {
55        return $this->httpErrorMessage;
56    }
57
58    /**
59     * Get the HTTP response body
60     *
61     * @return mixed
62     */
63    public function getHttpRespBody()
64    {
65        return $this->httpRespBody;
66    }
67}
68