@@ -245,46 +245,46 @@ |
||
| 245 | 245 | throw new DeepLException($responseArray['message'], $httpCode); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - /** |
|
| 249 | - * @see https://www.deepl.com/docs-api/accessing-the-api/error-handling/ |
|
| 250 | - */ |
|
| 251 | - switch ($httpCode) { |
|
| 252 | - case '400': |
|
| 253 | - throw new DeepLException('Bad request. Please check error message and your parameters.', $httpCode); |
|
| 254 | - break; |
|
| 255 | - |
|
| 256 | - case '403': |
|
| 257 | - throw new DeepLException('Authorization failed. Please supply a valid auth_key parameter.', $httpCode); |
|
| 258 | - break; |
|
| 259 | - |
|
| 260 | - case '404': |
|
| 261 | - throw new DeepLException('The requested resource could not be found.', $httpCode); |
|
| 262 | - break; |
|
| 263 | - |
|
| 264 | - case '413': |
|
| 265 | - throw new DeepLException('The request size exceeds the limit.', $httpCode); |
|
| 266 | - break; |
|
| 267 | - |
|
| 268 | - case '414': |
|
| 269 | - throw new DeepLException('The request URL is too long. You can avoid this error by using a POST request instead of a GET request, and sending the parameters in the HTTP body.', $httpCode); |
|
| 270 | - break; |
|
| 271 | - |
|
| 272 | - case '429': |
|
| 273 | - throw new DeepLException('Too many requests. Please wait and resend your request.', $httpCode); |
|
| 274 | - break; |
|
| 275 | - |
|
| 276 | - case '456': |
|
| 277 | - throw new DeepLException('Quota exceeded. The character limit has been reached.', $httpCode); |
|
| 278 | - break; |
|
| 279 | - |
|
| 280 | - case '503': |
|
| 281 | - throw new DeepLException('Resource currently unavailable. Try again later.', $httpCode); |
|
| 282 | - break; |
|
| 283 | - |
|
| 284 | - case '529': |
|
| 285 | - throw new DeepLException('Too many requests. Please wait and resend your request.', $httpCode); |
|
| 286 | - break; |
|
| 287 | - } |
|
| 248 | + /** |
|
| 249 | + * @see https://www.deepl.com/docs-api/accessing-the-api/error-handling/ |
|
| 250 | + */ |
|
| 251 | + switch ($httpCode) { |
|
| 252 | + case '400': |
|
| 253 | + throw new DeepLException('Bad request. Please check error message and your parameters.', $httpCode); |
|
| 254 | + break; |
|
| 255 | + |
|
| 256 | + case '403': |
|
| 257 | + throw new DeepLException('Authorization failed. Please supply a valid auth_key parameter.', $httpCode); |
|
| 258 | + break; |
|
| 259 | + |
|
| 260 | + case '404': |
|
| 261 | + throw new DeepLException('The requested resource could not be found.', $httpCode); |
|
| 262 | + break; |
|
| 263 | + |
|
| 264 | + case '413': |
|
| 265 | + throw new DeepLException('The request size exceeds the limit.', $httpCode); |
|
| 266 | + break; |
|
| 267 | + |
|
| 268 | + case '414': |
|
| 269 | + throw new DeepLException('The request URL is too long. You can avoid this error by using a POST request instead of a GET request, and sending the parameters in the HTTP body.', $httpCode); |
|
| 270 | + break; |
|
| 271 | + |
|
| 272 | + case '429': |
|
| 273 | + throw new DeepLException('Too many requests. Please wait and resend your request.', $httpCode); |
|
| 274 | + break; |
|
| 275 | + |
|
| 276 | + case '456': |
|
| 277 | + throw new DeepLException('Quota exceeded. The character limit has been reached.', $httpCode); |
|
| 278 | + break; |
|
| 279 | + |
|
| 280 | + case '503': |
|
| 281 | + throw new DeepLException('Resource currently unavailable. Try again later.', $httpCode); |
|
| 282 | + break; |
|
| 283 | + |
|
| 284 | + case '529': |
|
| 285 | + throw new DeepLException('Too many requests. Please wait and resend your request.', $httpCode); |
|
| 286 | + break; |
|
| 287 | + } |
|
| 288 | 288 | |
| 289 | 289 | if (!is_array($responseArray)) { |
| 290 | 290 | throw new DeepLException('The Response seems to not be valid JSON.', $httpCode); |