ardohr-ltd/starling-payments-objects

Creating a collection from an error Response fails

Closed this issue · 1 comments

Any non-collection response object can be created from an error response (e.g. a 400 or 404). That stores the error and the isError() method indicates that this has happened.

A collection response created in the same way (e.g. a collection as past payments, but for an account that is disabled, or when a network issue is happening) results in an exception. It shouldn't.

There is a little duplication in the HydratableTrait::fromResponse and the AbstractCollection::fromResponse that can be merged somewhere to neaten things up. But otherwise, this is fixed now.