Conversation
|
Not sure if we should provide the json-string version of the object in the error messages... I'm thinking we should not. Do you have an opinion on this @drew-gross ? |
|
Yeah my suggestion would be to not return that as an error. Too much potential for information to leak to people who shouldn't be able to see it. |
|
How can I modify these messages, or any variables I can get from JavascriptSDK? The messages are similar as current Parse API server response. |
|
@sdf611097 updated the pull request. |
|
Hi @gfosco @drew-gross , |
| } | ||
| break; | ||
| default : | ||
| throw new Parse.Error(Parse.Error.INCORRECT_TYPE, 'invalid type: ' + obj.__type); |
There was a problem hiding this comment.
as each case returns, you could just add after the switch throw new Parse.Error(Parse.Error.INCORRECT_TYPE, 'invalid type: ' + obj.__type);
|
@flovilmart has a good suggestion, but I'm going to merge this anyway. If you want to updated in a new PR, that would make the code a little cleaner :) |
Add __type checking
Avoid object saved with wrong format from REST API.