ActiveCampaign / activecampaign-api-php

MIT License
115 stars 76 forks source link

Add Greater Context to AC Exceptions #91

Closed bartboy011 closed 6 years ago

bartboy011 commented 6 years ago

This PR adds a private property $context to the RequestException class (and all inheritors). The property can be accessed through get/set methods. The point of this property is to add context to exceptions being thrown. The property, when added, is an associative array with two keys:

array(
    "request_url" => //,
    "request_body" => // is json_encoded
)

The intent is to add greater verbosity to all RequestExceptions to aid in faster debugging.

Additionally, this PR refactors the Connector class to add in the context to the exception when there's an issue with cURL requests.

@ActiveCampaign/integration