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)
|
.values(recording)
|
||||||
.onConflictDoNothing();
|
.onConflictDoNothing();
|
||||||
} catch (error) {
|
} 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(
|
logger.error(
|
||||||
{
|
{ id: recording.id, error: detail },
|
||||||
id: recording.id,
|
|
||||||
error: error instanceof Error ? error.message : String(error),
|
|
||||||
},
|
|
||||||
"Failed to insert voice recording",
|
"Failed to insert voice recording",
|
||||||
);
|
);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user