AminoJS / Amino.JS

A powerful JavaScript library for interacting with the Amino API :star2:
MIT License
27 stars 5 forks source link

JSON.parse Errors when Amino is having Service Maintence #53

Closed moelrobi closed 5 years ago

moelrobi commented 5 years ago

Describe the bug If Amino is down (Statuscode 500, etc.) then JSON.parse tries to compile the HTML Nginx File to JSON which is not going to work.

To Reproduce Wait until Amino Breaks and then try to interact with the API. (easy tbh since amino is down every 3 Hours or so)

Expected behavior A Error Handler trying to tell the person with a different Status code that Amino is Down.

akatsukilevi commented 5 years ago

NOTE: i managed to emulate part of the Amino Servers on a Linux workstation i have. I'll emulate a 500 error code and make a error handling to check if the amino is down before actually make a request

moelrobi commented 5 years ago

Just put this still into the 3.0.0 Update.

akatsukilevi commented 5 years ago

Okay, got it

akatsukilevi commented 5 years ago

Fixed. Now all of them throw an error like: Amino appears to be offline. Response status = [[ERROR CODE]]. Closing this issue as fixed