From c87e481ec95bf784369aa0b121e0b1f2d02ecbe4 Mon Sep 17 00:00:00 2001 From: Shadow Date: Fri, 13 Feb 2026 12:34:59 -0600 Subject: [PATCH] Discord: fix voice duration error handling --- src/discord/voice-message.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/discord/voice-message.ts b/src/discord/voice-message.ts index d03aa98ac8..a7e7c0014c 100644 --- a/src/discord/voice-message.ts +++ b/src/discord/voice-message.ts @@ -50,9 +50,8 @@ export async function getAudioDuration(filePath: string): Promise { } return Math.round(duration * 100) / 100; // Round to 2 decimal places } catch (err) { - throw new Error(`Failed to get audio duration: ${err instanceof Error ? err.message : err}`, { - cause: err, - }); + const errMessage = err instanceof Error ? err.message : String(err); + throw new Error(`Failed to get audio duration: ${errMessage}`, { cause: err }); } }