OWAPI icon indicating copy to clipboard operation
OWAPI copied to clipboard

Catch "Internal Error; We're upset too." correctly

Open justalemon opened this issue 5 years ago • 2 comments

Issue

Sometimes, the profiles will be down (as usual) and shown like this:

image

The API response will be:

{"error": 404, "msg": "profile not found"}

I feel that OWAPI should return an 5XX code, because the profile could exist but is not available at this time.

The HTML code shows something like like this:

image

Links that cause the issue

(Surround the links with backticks. Use triple backticks for multiple lines.)

https://owapi.net/api/v3/u/Dad-12262/blob
https://playoverwatch.com/en-us/career/pc/Dad-12262

Hi! Thank you for helping OWAPI by submitting an issue. Before you submit, please make sure you've done the following:

  • [ ] Google/Search previous issues to make sure it hasn't been answered before.

  • [ ] Ask if this is an OWAPI issue, or a Linux issue, etc.

    • OWAPI requires Python 3.5 or higher installed on a UNIX machine, and it's not really our job to troubleshoot random Linux errors.

Thanks!

justalemon avatar Jul 13 '18 09:07 justalemon

This is a great suggestion! I already got upset with Blizzard creating this error so often and on many profiles. Is there a chance to get a 503 - Service Unavailable error for example? Or maybe create your own error Code?

Am 13.07.2018 um 18:08 schrieb Hannele Ruiz [email protected]:

Issue

Sometimes, the profiles will be down (as usual) and shown like this:

The API response will be:

{"error": 404, "msg": "profile not found"} I feel that OWAPI should return an 5XX code, because the profile could exist but is not available at this time.

The HTML code shows something like like this:

Links that cause the issue

(Surround the links with backticks. Use triple backticks for multiple lines.)

https://owapi.net/api/v3/u/Dad-12262/blob https://playoverwatch.com/en-us/career/pc/Dad-12262 Hi! Thank you for helping OWAPI by submitting an issue. Before you submit, please make sure you've done the following:

Google/Search previous issues to make sure it hasn't been answered before.

Ask if this is an OWAPI issue, or a Linux issue, etc.

OWAPI requires Python 3.5 or higher installed on a UNIX machine, and it's not really our job to troubleshoot random Linux errors. Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jpylypiw avatar Jul 13 '18 09:07 jpylypiw

I already got upset with Blizzard creating this error so often and on many profiles.

I have to say, the playoverwatch.com page is terribly made. Most of the time you can't even log in without an "Internal Server Error".

Is there a chance to get a 503 - Service Unavailable error for example?

I would recommend 502 Bad Gateway:

The server was acting as a gateway or proxy and received an invalid response from the upstream server.

Or maybe create your own error Code?

As far as I know, you can't create your own status codes. But in certain cases (like Discord) you can send them in the JSON response.

justalemon avatar Jul 13 '18 19:07 justalemon