diff --git a/src/script/conversation/ConversationRepository.ts b/src/script/conversation/ConversationRepository.ts index 01a66f16893..9bb84fac350 100644 --- a/src/script/conversation/ConversationRepository.ts +++ b/src/script/conversation/ConversationRepository.ts @@ -2810,11 +2810,9 @@ export class ConversationRepository { const isExpectedType = typesInSelfConversation.includes(type); if (!isExpectedType) { - return Promise.reject( - new ConversationError( - ConversationError.TYPE.WRONG_CONVERSATION, - ConversationError.MESSAGE.WRONG_CONVERSATION, - ), + throw new ConversationError( + ConversationError.TYPE.WRONG_CONVERSATION, + ConversationError.MESSAGE.WRONG_CONVERSATION, ); } } diff --git a/src/script/error/BaseError.ts b/src/script/error/BaseError.ts index 46c031db0df..b8dd37f5f32 100644 --- a/src/script/error/BaseError.ts +++ b/src/script/error/BaseError.ts @@ -27,11 +27,9 @@ export class BaseError extends Error { type: BASE_ERROR_TYPE | string; constructor(type: BASE_ERROR_TYPE | string, message: string) { - super(); + super(message); this.type = type; - this.message = message; - this.stack = new Error().stack; this.name = this.constructor.name; }