Skip to content

ClientException does not provide error code as integer #14

@kmbt

Description

@kmbt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions