From ad56cfe3a55dba28b73dd178350296b8a2ccf7a8 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Fri, 12 Jul 2024 11:57:42 +0200 Subject: [PATCH] Error report improve --- src/app/events/character/CharacterCreate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/events/character/CharacterCreate.ts b/src/app/events/character/CharacterCreate.ts index 60a0219..1f77c71 100644 --- a/src/app/events/character/CharacterCreate.ts +++ b/src/app/events/character/CharacterCreate.ts @@ -31,7 +31,7 @@ export default function (socket: TSocket, io: Server) { socket.emit('character:create:success'); socket.emit('character:list', characters); } catch (error: any) { - return socket.emit('notification', {message: error.errors[0].message}); + return socket.emit('notification', {message: error.errors[0]?.message ?? 'Invalid data'}); } }); } \ No newline at end of file