@point-hub/papi 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +3 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -61244,10 +61244,10 @@ class MongoDBConnection {
|
|
|
61244
61244
|
// src/database/mongodb/mongodb-error-handler.ts
|
|
61245
61245
|
function handleSchemaValidation(err, error) {
|
|
61246
61246
|
error.errors = {};
|
|
61247
|
-
const errorMessage = err.errInfo?.details.schemaRulesNotSatisfied[0].
|
|
61247
|
+
const errorMessage = err.errInfo?.details.schemaRulesNotSatisfied[0].missingProperties;
|
|
61248
61248
|
errorMessage.forEach((element) => {
|
|
61249
61249
|
const obj = {};
|
|
61250
|
-
obj[element
|
|
61250
|
+
obj[element] = [`${element} is required`];
|
|
61251
61251
|
error.errors = obj;
|
|
61252
61252
|
});
|
|
61253
61253
|
}
|
|
@@ -61285,7 +61285,7 @@ class MongoErrorHandler extends BaseError {
|
|
|
61285
61285
|
} else if (err.code === 11000) {
|
|
61286
61286
|
handleUniqueValidation(err, error);
|
|
61287
61287
|
} else {
|
|
61288
|
-
console.error(err);
|
|
61288
|
+
console.error(JSON.stringify(err));
|
|
61289
61289
|
}
|
|
61290
61290
|
super(error);
|
|
61291
61291
|
Object.setPrototypeOf(this, new.target.prototype);
|