Skip to content

Commit d7181f6

Browse files
committed
new api client 410 gone exception
1 parent 771a3c4 commit d7181f6

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SimpleAsFuck\ApiToolkit\Model\Client;
6+
7+
final class GoneApiException extends ResponseApiException
8+
{
9+
}

src/Service/Client/ApiClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use SimpleAsFuck\ApiToolkit\Model\Client\BadRequestApiException;
1717
use SimpleAsFuck\ApiToolkit\Model\Client\ConflictApiException;
1818
use SimpleAsFuck\ApiToolkit\Model\Client\ForbiddenApiException;
19+
use SimpleAsFuck\ApiToolkit\Model\Client\GoneApiException;
1920
use SimpleAsFuck\ApiToolkit\Model\Client\NotFoundApiException;
2021
use SimpleAsFuck\ApiToolkit\Model\Client\Request;
2122
use SimpleAsFuck\ApiToolkit\Model\Client\Response;
@@ -143,22 +144,21 @@ public function waitRaw(PromiseInterface $promise): Response
143144
if ($response->getStatusCode() === HttpCodes::HTTP_BAD_REQUEST) {
144145
throw new BadRequestApiException($response, $message, $exception);
145146
}
146-
147147
if ($response->getStatusCode() === HttpCodes::HTTP_UNAUTHORIZED) {
148148
throw new UnauthorizedApiException($response, $message, $exception);
149149
}
150-
151150
if ($response->getStatusCode() === HttpCodes::HTTP_FORBIDDEN) {
152151
throw new ForbiddenApiException($response, $message, $exception);
153152
}
154-
155153
if ($response->getStatusCode() === HttpCodes::HTTP_NOT_FOUND) {
156154
throw new NotFoundApiException($response, $message, $exception);
157155
}
158-
159156
if ($response->getStatusCode() === HttpCodes::HTTP_CONFLICT) {
160157
throw new ConflictApiException($response, $message, $exception);
161158
}
159+
if ($response->getStatusCode() === HttpCodes::HTTP_GONE) {
160+
throw new GoneApiException($response, $message, $exception);
161+
}
162162

163163
throw new ResponseApiException($response, $message, $exception);
164164
}

0 commit comments

Comments
 (0)