From 88410b409ab9bfed11aa8fa0632c8de8de690926 Mon Sep 17 00:00:00 2001 From: Salakar Date: Mon, 16 Apr 2018 17:39:29 +0100 Subject: [PATCH] [firestore] fix incomplete transaction error stack --- lib/modules/firestore/TransactionHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/firestore/TransactionHandler.js b/lib/modules/firestore/TransactionHandler.js index b8673729..9c8f51a5 100644 --- a/lib/modules/firestore/TransactionHandler.js +++ b/lib/modules/firestore/TransactionHandler.js @@ -72,7 +72,7 @@ export default class TransactionHandler { updateFunction, stack: new Error().stack .split('\n') - .slice(4) + .slice(2) .join('\n'), }; @@ -215,7 +215,7 @@ export default class TransactionHandler { // $FlowExpectedError: code is needed for Firebase errors errorWithStack.code = code; // $FlowExpectedError: stack should be a stack trace - errorWithStack.stack = meta.stack; + errorWithStack.stack = `Error: ${message}\n${meta.stack}`; // $FlowExpectedError: Reject will always be present meta.reject(errorWithStack);