From 946381226f9ba43f5981af801bd27a24a6606bf3 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 5 Oct 2020 02:00:00 +0200 Subject: [PATCH] Save stacktrace of unknown errors --- src/function/sync/apply-actions/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/function/sync/apply-actions/index.ts b/src/function/sync/apply-actions/index.ts index 692387c..c83c902 100644 --- a/src/function/sync/apply-actions/index.ts +++ b/src/function/sync/apply-actions/index.ts @@ -107,7 +107,9 @@ export const applyActionsFromDevice = async ({ database, request, websocket, con if (ex instanceof ApplyActionException) { eventHandler.countEvent('applyActionsFromDevice errorDispatchingAction:' + ex.staticMessage) } else { - eventHandler.countEvent('applyActionsFromDevice errorDispatchingAction:other') + const stack = ex instanceof Error && ex.stack ? ex.stack.substring(0, 4096) : 'no stack' + + eventHandler.countEvent('applyActionsFromDevice errorDispatchingAction:other:' + stack) } cache.requireFullSync()