superfaceai / service-client

Library provides client for superface backend apis.
MIT License
5 stars 1 forks source link

Throw custom errors #42

Closed freaz closed 3 years ago

freaz commented 3 years ago

To be able to properly act on error s returned from service client, I need to be able to distinguish and understand it's errors and in case of error coming from Store API, be able to get details without parsing error message.

To achieve it, I am adding two custom errors: ServiceClientError generic error which should be thrown by service client and StoreApiError for non success responses from Store API.

freaz commented 3 years ago

@janhalama as discussed on Slack. Renamed StoreApiError to more generic ServiceApiError, and updated CHANGELOG.md