Parse-SDK-JS icon indicating copy to clipboard operation
Parse-SDK-JS copied to clipboard

Change default connection failure message

Open dblythy opened this issue 3 years ago • 3 comments

New Feature / Enhancement Checklist

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

related

dblythy avatar Apr 01 '22 09:04 dblythy

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?

mtrezza avatar Apr 04 '22 00:04 mtrezza

I will have to do some investigating

dblythy avatar Apr 04 '22 00:04 dblythy