Fix early server response in Schema validation.
This commit is contained in:
@@ -448,9 +448,12 @@ class Schema {
|
|||||||
geocount++;
|
geocount++;
|
||||||
}
|
}
|
||||||
if (geocount > 1) {
|
if (geocount > 1) {
|
||||||
throw new Parse.Error(
|
// Make sure all field validation operations run before we return.
|
||||||
Parse.Error.INCORRECT_TYPE,
|
// If not - we are continuing to run logic, but already provided response from the server.
|
||||||
'there can only be one geopoint field in a class');
|
return promise.then(() => {
|
||||||
|
return Promise.reject(new Parse.Error(Parse.Error.INCORRECT_TYPE,
|
||||||
|
'there can only be one geopoint field in a class'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!expected) {
|
if (!expected) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user