|
3 | 3 |
|
4 | 4 | var SchemaController = require('./Controllers/SchemaController'); |
5 | 5 | var Parse = require('parse/node').Parse; |
| 6 | +var logger = require('./logger').default; |
6 | 7 | const triggers = require('./triggers'); |
7 | 8 | const { continueWhile } = require('parse/lib/node/promiseUtils'); |
8 | 9 | const AlwaysSelectedKeys = ['objectId', 'createdAt', 'updatedAt', 'ACL']; |
@@ -467,10 +468,9 @@ _UnsafeRestQuery.prototype.checkSubqueryDepth = function () { |
467 | 468 | } |
468 | 469 | const depth = this.context._subqueryDepth || 0; |
469 | 470 | if (depth > rc.subqueryDepth) { |
470 | | - throw new Parse.Error( |
471 | | - Parse.Error.INVALID_QUERY, |
472 | | - `Subquery nesting depth exceeds maximum allowed depth of ${rc.subqueryDepth}` |
473 | | - ); |
| 471 | + const message = `Subquery nesting depth exceeds maximum allowed depth of ${rc.subqueryDepth}`; |
| 472 | + logger.warn(message); |
| 473 | + throw new Parse.Error(Parse.Error.INVALID_QUERY, message); |
474 | 474 | } |
475 | 475 | }; |
476 | 476 |
|
@@ -898,17 +898,15 @@ _UnsafeRestQuery.prototype.validateIncludeComplexity = function () { |
898 | 898 | if (rc.includeDepth !== -1 && this.include && this.include.length > 0) { |
899 | 899 | const maxDepth = Math.max(...this.include.map(path => path.length)); |
900 | 900 | if (maxDepth > rc.includeDepth) { |
901 | | - throw new Parse.Error( |
902 | | - Parse.Error.INVALID_QUERY, |
903 | | - `Include depth of ${maxDepth} exceeds maximum allowed depth of ${rc.includeDepth}` |
904 | | - ); |
| 901 | + const message = `Include depth of ${maxDepth} exceeds maximum allowed depth of ${rc.includeDepth}`; |
| 902 | + logger.warn(message); |
| 903 | + throw new Parse.Error(Parse.Error.INVALID_QUERY, message); |
905 | 904 | } |
906 | 905 | } |
907 | 906 | if (rc.includeCount !== -1 && this.include && this.include.length > rc.includeCount) { |
908 | | - throw new Parse.Error( |
909 | | - Parse.Error.INVALID_QUERY, |
910 | | - `Number of include fields (${this.include.length}) exceeds maximum allowed (${rc.includeCount})` |
911 | | - ); |
| 907 | + const message = `Number of include fields (${this.include.length}) exceeds maximum allowed (${rc.includeCount})`; |
| 908 | + logger.warn(message); |
| 909 | + throw new Parse.Error(Parse.Error.INVALID_QUERY, message); |
912 | 910 | } |
913 | 911 | }; |
914 | 912 |
|
|
0 commit comments