Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CurlClient exception handling #27

Closed
przemeko opened this issue Jun 23, 2017 · 1 comment
Closed

CurlClient exception handling #27

przemeko opened this issue Jun 23, 2017 · 1 comment

Comments

@przemeko
Copy link

In Adyen\HttpClient\CurlClient there are 2 private methods:

  • handleCurlError
  • handleResultError

They both returns the same exception: \Adyen\AdyenException
So there's no way to distinguish connection errors and "api result" errors (i.e that would allow to decide to retry payment or not.)

My proposal is to return two different exceptions:

  • \Adyen\ConnectionExceptionin handleCurlError
  • \Adyen\AdyenException in handleResultError
@rikterbeek
Copy link
Contributor

Hi @przemeko,

I understand your issue. There is a way to distinguish the error based on the message of the exception but would be indeed better to use different exception classes so you can create your own catches. I will make a change in the code to make this possible.

Regards,
Rik
Adyen

rikterbeek added a commit that referenced this issue Jun 26, 2017
…onnectionException for empty result from API result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants