Added sendMessage method

This commit is contained in:
Alex
2025-07-12 21:39:16 +03:00
parent 0c91886ff0
commit c8f87c70b6
10 changed files with 297 additions and 3 deletions
+1 -3
View File
@@ -119,7 +119,7 @@ final class Client implements ClientApiInterface
$errorCode = $data['code'] ?? 'unknown';
$errorMessage = $data['message'] ?? 'An unknown error occurred.';
$exception = match ($statusCode) {
throw match ($statusCode) {
401 => new UnauthorizedException($errorMessage, $errorCode, $response),
403 => new ForbiddenException($errorMessage, $errorCode, $response),
404 => new NotFoundException($errorMessage, $errorCode, $response),
@@ -127,7 +127,5 @@ final class Client implements ClientApiInterface
429 => new RateLimitExceededException($errorMessage, $errorCode, $response),
default => new ClientApiException($errorMessage, $errorCode, $response, $statusCode),
};
throw $exception;
}
}