From 059d569566c1aace3387b4a52914e928a6492906 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Sun, 17 May 2026 23:05:50 +0700 Subject: [PATCH] fix: refactor constructor parameter properties in errors.ts to prevent strip-only mode type stripping errors --- src/errors.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/errors.ts b/src/errors.ts index 1b26a4d..f6dcf47 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,10 +1,15 @@ export class AppError extends Error { + public code: string; + public statusCode: number; + constructor( message: string, - public code: string, - public statusCode: number = 500, + code: string, + statusCode: number = 500, ) { super(message); + this.code = code; + this.statusCode = statusCode; this.name = "AppError"; Error.captureStackTrace(this, this.constructor); } @@ -32,11 +37,14 @@ export class VoiceConnectionError extends AppError { } export class ValidationError extends AppError { + public details?: Record; + constructor( message: string, - public details?: Record, + details?: Record, ) { super(message, "VALIDATION_ERROR", 400); + this.details = details; this.name = "ValidationError"; } }