From 3dd56c711ec79547ba4fd081ed18f9f987b5cd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 1 Nov 2025 22:32:26 +0800 Subject: [PATCH] Throw original error in sendMsg method Replaces the re-throwing of a new Error with the original error object in the sendMsg method, preserving the original error stack and type for better debugging. --- src/onebot/api/msg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 2a510df4..e6cd2c22 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -1182,7 +1182,7 @@ export class OneBotMsgApi { }, returnMsg.msgId); return returnMsg; } catch (error) { - throw new Error((error as Error).message); + throw error; } finally { cleanTaskQueue.addFiles(deleteAfterSentFiles, timeout); // setTimeout(async () => {