Skip to content

Commit

Permalink
Merge pull request #14568 from Automattic/vkarpov15/gh-14529-2
Browse files Browse the repository at this point in the history
fix(error): remove model property from CastError to avoid printing all model properties to console
  • Loading branch information
vkarpov15 committed May 6, 2024
2 parents 2671828 + 6ca92be commit 8eefd65
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/error/cast.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class CastError extends MongooseError {
* ignore
*/
setModel(model) {
this.model = model;
this.message = formatMessage(model, this.kind, this.value, this.path,
this.messageFormat, this.valueType);
}
Expand Down
1 change: 0 additions & 1 deletion types/error.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ declare module 'mongoose' {
value: any;
path: string;
reason?: NativeError | null;
model?: any;

constructor(type: string, value: any, path: string, reason?: NativeError, schemaType?: SchemaType);
}
Expand Down

0 comments on commit 8eefd65

Please sign in to comment.