Added Server Response Error Handling #1011

Merged
ProfessorDey merged 2 commits from patch-1 into master 2019-05-31 20:36:09 +02:00
ProfessorDey commented 2019-05-30 15:35:55 +02:00 (Migrated from github.com)

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.

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 2019-05-30 15:49:39 +02:00 (Migrated from github.com)

Thanks Dey! Sent you some appreciation on Discord.

Thanks Dey! Sent you some appreciation on Discord.
jessopb (Migrated from github.com) requested changes 2019-05-30 21:08:48 +02:00
jessopb (Migrated from github.com) left a comment

Awesome, thanks for this!
Just 2 minor things:

  • the 200 case: content has wonky indentation
  • can you replace the 4 in (xhr.readyState === 4) with the constant XMLHttpRequest.DONE ?
Awesome, thanks for this! Just 2 minor things: - the 200 case: content has wonky indentation - can you replace the 4 in (xhr.readyState === 4) with the constant XMLHttpRequest.DONE ?
ProfessorDey commented 2019-05-31 01:17:33 +02:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/spee.ch#1011
No description provided.