Skip to content

Commit c6d426c

Browse files
committed
Added unauthorized exception message
1 parent a017521 commit c6d426c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ protected function handleRequestError(ResponseInterface $response)
251251
}
252252

253253
if ($response->getStatusCode() == 401 || $response->getStatusCode() == 403) {
254-
throw new UnauthorizedException();
254+
throw new UnauthorizedException((string) $response->getBody());
255255
}
256256

257257
if ($response->getStatusCode() == 400) {

src/Exceptions/UnauthorizedException.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,13 @@
44

55
class UnauthorizedException extends \Exception
66
{
7-
//
7+
/**
8+
* Create a new exception instance.
9+
*
10+
* @param string $message
11+
*/
12+
public function __construct(string $message = '')
13+
{
14+
parent::__construct($message);
15+
}
816
}

0 commit comments

Comments
 (0)