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

Only catching guzzle ClientException, ServerException gets through #16

Open
TamasSzigeti opened this issue Jul 5, 2018 · 4 comments
Open

Comments

@TamasSzigeti
Copy link

Hi,

thanking for this package, great help!

Every now and then, autopilot returns an 500 Internal Server Error, which Guzzle turns into a ServerException. As the AutopilotManager api methods only catch and transform ClientException into AutopilotException, ServerException gets through to the calling code.

Shall I create a PR?

@nicolasThal
Copy link
Contributor

Hi,

I think that catching all the server errors from autopilot would be great. It would hide some call errors.

We can still modify the package to fit your behaviour.

Do you have any idea why autopilot return you a 500 error ?
Is the error return any different from other api errors ?

Thank you for your help,
Nicolas

@TamasSzigeti
Copy link
Author

Thanks for responding!
Not sure why it return ISE 500, but it does, quite often.
From today's logs:

Server error: `POST https://api2.autopilothq.com/v1/contact` resulted in a `500 Internal Server Error` response:
{"error":"Internal Server Error","message":"Internal Server Error. See status page http://status.autopilothq.com

And then their status page doesn't say anything was wrong

@nicolasThal
Copy link
Contributor

This kind of errors seems pretty weird.

If you perform twice the post request, does it return 500 errors each time ?
If it is not the case, we could rerun the request in case of a ServerException from guzzle.

Did you ask autopilot why they have this kind of errors ?

@TamasSzigeti
Copy link
Author

I don't think your lib should repeat the request, that should be left to the consumer IMO.
I'm sure there are cases when repeating the call would help, in other cases it wouldn't.

I haven't contacted autopilot about it so far, but good idea.

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