|
throw new \FreshMail\ApiV2\ClientException(sprintf('Connection error, error message: '.$exception->getMessage())); |
\FreshMail\ApiV2\ClientException only holds a message such as:
Connection error, error message: Client error: `POST https://api.freshmail.com/rest/subscriber/add` resulted in a `422 Unprocessable Entity` response:
{"status":"ERROR","errors":[{"message":"Subscribers already exists in this subscribers list","code":1304}]}
This is not much use for handling this exception in code, as the exception code 1304 is not directly provided on the \FreshMail\ApiV2\ClientException object. It is only a part of the message string.
It would be tremendously useful if the code was easily accessible on the exception object as simple integer.
REST-API/src/FreshMail/Client.php
Line 77 in 053b7ec
\FreshMail\ApiV2\ClientExceptiononly holds a message such as:This is not much use for handling this exception in code, as the exception code
1304is not directly provided on the\FreshMail\ApiV2\ClientExceptionobject. It is only a part of the message string.It would be tremendously useful if the code was easily accessible on the exception object as simple integer.