Skip to content

Commit ee9748b

Browse files
committed
refactor: throw exception if resource return not found error
1 parent 771ea38 commit ee9748b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Response/HttpStatusVerification.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@
1919

2020
class HttpStatusVerification
2121
{
22+
protected const ERROR_NOT_FOUND = 'error: not found';
23+
2224
public static function validateStatus(ResponseInterface $response): void
2325
{
26+
if (HandleResponse::getBody($response) == self::ERROR_NOT_FOUND) {
27+
throw new Exception('Attempted function call was not found');
28+
}
29+
2430
$statusCode = $response->getStatusCode();
2531

2632
switch ($statusCode) {

0 commit comments

Comments
 (0)