From d08d357460a2f9beebccb9c5d8e5c396a94e087d Mon Sep 17 00:00:00 2001 From: ANNABELJOE Date: Mon, 1 Jun 2026 05:20:04 +0000 Subject: [PATCH] fix(backend): restore prototype chain on ValidationError for correct instanceof (#656) --- backend/src/kyc-upsert-service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/kyc-upsert-service.ts b/backend/src/kyc-upsert-service.ts index aeabd083..a191dc83 100644 --- a/backend/src/kyc-upsert-service.ts +++ b/backend/src/kyc-upsert-service.ts @@ -8,6 +8,8 @@ export class ValidationError extends Error { constructor(message: string) { super(message); this.name = 'ValidationError'; + // Restore prototype chain so `instanceof ValidationError` works after transpilation + Object.setPrototypeOf(this, new.target.prototype); } }