|
@@ 350-359 (lines=10) @@
|
| 347 |
|
* |
| 348 |
|
* @return \Fresh\SinchBundle\Exception\SinchException|null |
| 349 |
|
*/ |
| 350 |
|
private function getSinchExceptionForUnauthorized($errorCode, $errorMessage) |
| 351 |
|
{ |
| 352 |
|
$exception = null; |
| 353 |
|
|
| 354 |
|
if (SinchErrorCode::ILLEGAL_AUTHORIZATION_HEADER === $errorCode) { |
| 355 |
|
$exception = new SinchIllegalAuthorizationHeaderException($errorMessage); |
| 356 |
|
} |
| 357 |
|
|
| 358 |
|
return $exception; |
| 359 |
|
} |
| 360 |
|
|
| 361 |
|
/** |
| 362 |
|
* Get Sinch exception for payment required |
|
@@ 371-380 (lines=10) @@
|
| 368 |
|
* |
| 369 |
|
* @return \Fresh\SinchBundle\Exception\SinchException|null |
| 370 |
|
*/ |
| 371 |
|
private function getSinchExceptionForPaymentRequired($errorCode, $errorMessage) |
| 372 |
|
{ |
| 373 |
|
$exception = null; |
| 374 |
|
|
| 375 |
|
if (SinchErrorCode::THERE_IS_NOT_ENOUGH_FUNDS_TO_SEND_THE_MESSAGE === $errorCode) { |
| 376 |
|
$exception = new SinchPaymentRequiredException($errorMessage); |
| 377 |
|
} |
| 378 |
|
|
| 379 |
|
return $exception; |
| 380 |
|
} |
| 381 |
|
|
| 382 |
|
/** |
| 383 |
|
* Get Sinch exception for forbidden |
|
@@ 418-427 (lines=10) @@
|
| 415 |
|
* |
| 416 |
|
* @return \Fresh\SinchBundle\Exception\SinchException|null |
| 417 |
|
*/ |
| 418 |
|
private function getSinchExceptionForInternalServerError($errorCode, $errorMessage) |
| 419 |
|
{ |
| 420 |
|
$exception = null; |
| 421 |
|
|
| 422 |
|
if (SinchErrorCode::INTERNAL_ERROR === $errorCode) { |
| 423 |
|
$exception = new SinchInternalErrorException($errorMessage); |
| 424 |
|
} |
| 425 |
|
|
| 426 |
|
return $exception; |
| 427 |
|
} |
| 428 |
|
|
| 429 |
|
// endregion |
| 430 |
|
} |