From bc5d1df8275e85fdb68fc84943ef44e57a90fd1e Mon Sep 17 00:00:00 2001 From: Levan Velijanashvili Date: Wed, 30 Nov 2022 01:32:47 +0400 Subject: [PATCH] Throw TranslationDecodingException --- src/GoogleTranslate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GoogleTranslate.php b/src/GoogleTranslate.php index 63455f1..1fe4250 100644 --- a/src/GoogleTranslate.php +++ b/src/GoogleTranslate.php @@ -333,7 +333,7 @@ public function getResponse(string $string): array try { $bodyArray = json_decode($bodyJson, true, flags: JSON_THROW_ON_ERROR); } catch (JsonException) { - throw new UnexpectedValueException('Data cannot be decoded or it is deeper than the recursion limit'); + throw new TranslationDecodingException('Data cannot be decoded or it is deeper than the recursion limit'); } return $bodyArray;