Change default connection failure message
New Feature / Enhancement Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am not just asking a question.
- [x] I have searched through existing issues.
Current Limitation
If Parse JS SDK is unable to connect to the server, the error thrown is 'XMLHttpRequest failed: "Unable to connect to the Parse API" which is rather confusing for client users.
Feature / Enhancement Description
It would be good to change the default error message to something more helpful such as Could not connect to the server which non-technical users could understand. Or, allow JS SDK to specify custom error messages via something like Parse.customError.101
Example Use Case
n/a
Alternatives / Workarounds
n/a
3rd Party References
Thanks for opening this issue!
- 🎉 We are excited about your ideas for improvement!
How about throwing the Parse.Error:
ConnectionFailed | 100 | The connection to the Parse servers failed.
I classified this as a bug, because we do have an explicit Parse.Error defined for this and it is not thrown.
This looks like a breaking change. If the error currently thrown has no error code, only the message, then someone parsing for that string (instead of comparing error codes as it should be) will have to change their client code, right?
I will have to do some investigating