-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-fatal error handling #8
base: master
Are you sure you want to change the base?
Conversation
utils.js
Outdated
msg = "Error"; | ||
} | ||
ws.close(code, msg); | ||
ws.send(JSON.stringify({event: 'error', code: code, message: msg})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, code, message:
(can always omit matching variable names now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so write the new code in ES6 everywhere.
This checks for There are 3 exceptional errors that don't return requestID, because can't parse/validate:
Let's call those implementation errors. If a client is properly coded those errors shouldn't happen. Unless the data is corrupted while transferred, which should be fatal anyway. In those cases it would make sense to close the connection. Maybe that's the answer to the question which errors should be fatal and which not. UPDATE: |
But actually |
d914115
to
adfef40
Compare
Removed requestID commit. Arkivo no longer needs this. If we will need this for other things we could return back this feature in future. So what it does now is just instead of closing connection, it sends the error. Also fixes bug which exposes 500 error even for non dev site. |
This is a possible solution to error handling in a non-fatal way.