|
18 | 18 | use Instant2FA\Serializer\VerificationRequestSerializer;
|
19 | 19 | use Instant2FA\Serializer\VerificationResponseSerializer;
|
20 | 20 |
|
| 21 | +use Instant2FA\Error\Instant2FAException; |
21 | 22 | use Instant2FA\Error\APIException;
|
22 | 23 | use Instant2FA\Error\MFANotEnabled;
|
23 | 24 | use Instant2FA\Error\VerificationFailedException;
|
@@ -80,6 +81,8 @@ public function create_settings($distinct_id) {
|
80 | 81 | $error_body = $response->getBody();
|
81 | 82 | $doc = $this->decoder->decode($error_body);
|
82 | 83 | throw new APIException($doc->errors);
|
| 84 | + } else { |
| 85 | + throw new Instant2FAException($e->getMessage()); |
83 | 86 | }
|
84 | 87 | }
|
85 | 88 |
|
@@ -110,6 +113,8 @@ public function create_verification($distinct_id) {
|
110 | 113 | $error_body = $response->getBody();
|
111 | 114 | $doc = $this->decoder->decode($error_body);
|
112 | 115 | throw new APIException($doc->errors);
|
| 116 | + } else { |
| 117 | + throw new Instant2FAException($e->getMessage()); |
113 | 118 | }
|
114 | 119 | }
|
115 | 120 | $body = $response->getBody();
|
@@ -144,6 +149,8 @@ public function confirm_verification($distinct_id, $token) {
|
144 | 149 | $error_body = $response->getBody();
|
145 | 150 | $doc = $this->decoder->decode($error_body);
|
146 | 151 | throw new APIException($doc->errors);
|
| 152 | + } else { |
| 153 | + throw new Instant2FAException($e->getMessage()); |
147 | 154 | }
|
148 | 155 | }
|
149 | 156 | $body = $response->getBody();
|
|
0 commit comments