[firestore] fix incomplete transaction error stack

This commit is contained in:
Salakar 2018-04-16 17:39:29 +01:00
parent 317b02b901
commit 88410b409a
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ export default class TransactionHandler {
updateFunction, updateFunction,
stack: new Error().stack stack: new Error().stack
.split('\n') .split('\n')
.slice(4) .slice(2)
.join('\n'), .join('\n'),
}; };
@ -215,7 +215,7 @@ export default class TransactionHandler {
// $FlowExpectedError: code is needed for Firebase errors // $FlowExpectedError: code is needed for Firebase errors
errorWithStack.code = code; errorWithStack.code = code;
// $FlowExpectedError: stack should be a stack trace // $FlowExpectedError: stack should be a stack trace
errorWithStack.stack = meta.stack; errorWithStack.stack = `Error: ${message}\n${meta.stack}`;
// $FlowExpectedError: Reject will always be present // $FlowExpectedError: Reject will always be present
meta.reject(errorWithStack); meta.reject(errorWithStack);