Open
Description
Sente will throw an error when an ajax timeout occurs. This behavior was introduced recently, with 9da662c.
This is a reasonable decision, however I would like to make a couple of comments and raise a couple of questions.
- Most of the ajax timeouts I am seeing result from stale connections due to prolonged inactivity, for example, myself coming back to the browser after my laptop resumed from sleep. This cause for the error I consider benign.
- Logs on a busy production server will show many of those uncaught errors over time.
- We should probably explain that this is going to happen in the README, and show how to catch the error and where. Examples should be given.
- The ex-data for now contains only the value of
:timeout-msecs
. It should be enhanced with data from the request such as its origin. Presumably available from the function argumentsch
but I am currently blanking as to what and how much information can be recalled from that.
Another perspective on this is the following:
- Do not throw the error by default, but as an opt-in setting in Sente's constructor.
- Motivation is quality of life for the developer.
- The assumption here is that most readout errors are harmless and more importantly, unrecoverable.
- Throwing the error is probably reserved for debugging.
That's it from me as for this issue. I'll be happy to hear what you all think.