chore(services): update components based on recent changes
Changes: services/discord-gateway/src/shared/database/voiceRecordingRepo.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
This commit is contained in:
@@ -40,11 +40,21 @@ export async function insertVoiceRecording(
|
||||
.values(recording)
|
||||
.onConflictDoNothing();
|
||||
} catch (error) {
|
||||
const detail =
|
||||
error instanceof Error
|
||||
? {
|
||||
message: error.message,
|
||||
name: error.name,
|
||||
...((error as Record<string, unknown>).code !== undefined
|
||||
? { code: (error as Record<string, unknown>).code }
|
||||
: {}),
|
||||
...((error as Record<string, unknown>).detail !== undefined
|
||||
? { detail: (error as Record<string, unknown>).detail }
|
||||
: {}),
|
||||
}
|
||||
: String(error);
|
||||
logger.error(
|
||||
{
|
||||
id: recording.id,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
},
|
||||
{ id: recording.id, error: detail },
|
||||
"Failed to insert voice recording",
|
||||
);
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user