|
@@ 110-119 (lines=10) @@
|
| 107 |
|
* |
| 108 |
|
* @return \Fresh\SinchBundle\Exception\SinchException|null |
| 109 |
|
*/ |
| 110 |
|
private static function getSinchExceptionForUnauthorized($errorCode, $errorMessage) |
| 111 |
|
{ |
| 112 |
|
$exception = null; |
| 113 |
|
|
| 114 |
|
if (SinchErrorCode::ILLEGAL_AUTHORIZATION_HEADER === $errorCode) { |
| 115 |
|
$exception = new SinchIllegalAuthorizationHeaderException($errorMessage); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
return $exception; |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
/** |
| 122 |
|
* Get Sinch exception for payment required |
|
@@ 131-140 (lines=10) @@
|
| 128 |
|
* |
| 129 |
|
* @return \Fresh\SinchBundle\Exception\SinchException|null |
| 130 |
|
*/ |
| 131 |
|
private static function getSinchExceptionForPaymentRequired($errorCode, $errorMessage) |
| 132 |
|
{ |
| 133 |
|
$exception = null; |
| 134 |
|
|
| 135 |
|
if (SinchErrorCode::THERE_IS_NOT_ENOUGH_FUNDS_TO_SEND_THE_MESSAGE === $errorCode) { |
| 136 |
|
$exception = new SinchPaymentRequiredException($errorMessage); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
return $exception; |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
/** |
| 143 |
|
* Get Sinch exception for forbidden |
|
@@ 178-187 (lines=10) @@
|
| 175 |
|
* |
| 176 |
|
* @return \Fresh\SinchBundle\Exception\SinchException|null |
| 177 |
|
*/ |
| 178 |
|
private static function getSinchExceptionForInternalServerError($errorCode, $errorMessage) |
| 179 |
|
{ |
| 180 |
|
$exception = null; |
| 181 |
|
|
| 182 |
|
if (SinchErrorCode::INTERNAL_ERROR === $errorCode) { |
| 183 |
|
$exception = new SinchInternalErrorException($errorMessage); |
| 184 |
|
} |
| 185 |
|
|
| 186 |
|
return $exception; |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
// endregion |
| 190 |
|
} |