From 75cb7f8b368781b467a42ea97040a97eebf40baf Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 20 Jan 2020 01:52:35 +0900 Subject: [PATCH] Fix #5728 (#5731) --- src/queue/index.ts | 6 +++--- src/server/api/call.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/queue/index.ts b/src/queue/index.ts index 2d3cf6ee3..ad7453353 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -27,9 +27,9 @@ function initializeQueue(name: string) { function renderError(e: Error): any { return { - stack: e.stack, - message: e.message, - name: e.name + stack: e?.stack, + message: e?.message, + name: e?.name }; } diff --git a/src/server/api/call.ts b/src/server/api/call.ts index 8be1b71cf..37bcf7ce1 100644 --- a/src/server/api/call.ts +++ b/src/server/api/call.ts @@ -81,16 +81,16 @@ export default async (endpoint: string, user: User | null | undefined, app: App ep: ep.name, ps: data, e: { - message: e.message, - code: e.name, - stack: e.stack + message: e?.message, + code: e?.name, + stack: e?.stack } }); throw new ApiError(null, { e: { - message: e.message, - code: e.name, - stack: e.stack + message: e?.message, + code: e?.name, + stack: e?.stack } }); }