lbryio / spee.ch

An image hosting service on top of the LBRY protocol.
https://spee.ch
MIT License
185 stars 78 forks source link

Added Server Response Error Handling #1011

Closed ProfessorDey closed 5 years ago

ProfessorDey commented 5 years ago

Presently the spee.ch client will error out if it received an unexpected response, resulting in hangs and a very vague JSON parsing error. This failsafe will catch the known issue of server request size limits causing 413 responses if misconfigured, making things easier to diagnose, as well as catching any other unexpected responses cleanly. Further specific behaviours can be added to ensure administrators spend less time debugging simple configuration issues.

The 413 error response should be fairly self explanatory, sufficient to not need further documentation, though adding an addendum to the README.md would aid other developers have a smooth experience.

tzarebczan commented 5 years ago

Thanks Dey! Sent you some appreciation on Discord.

ProfessorDey commented 5 years ago

There you go @jessopb, as per request I fixed the indenting (Was actually an issue where the first and third cases had tabs at the start which threw off the indentation, fixed everything to standard double space, as is most common practice. Also made the requested change for the ready state check.