-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add __type checking #710
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
Add __type checking #710
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.