Skip to content

Commit

Permalink
Update packages/core/src/index.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Shigma <shigma10826@gmail.com>
  • Loading branch information
undefined-moe and shigma authored Aug 16, 2024
1 parent 193e528 commit 2b61d81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ValidationError extends TypeError {

const errorBuilder = (options: Schemastery.Options = {}) => (e: any) => {
if (e instanceof Schema.ValidationError) return e;
if (typeof e === 'object' && 'message' in e) return new Schema.ValidationError(e.message, options.path)
if (e instanceof Object && 'message' in e) return new Schema.ValidationError(e.message, options.path)
return e
}

Expand Down

0 comments on commit 2b61d81

Please sign in to comment.