node_modules/@google-cloud/firestore/build/src/util.js
/**
 * Wraps the provided error in a new error that includes the provided stack.
 *
 * Used to preserve stack traces across async calls.
 * @private
 */
Wraps the provided error in a new error that includes the provided stack.
Used to preserve stack traces across async calls.
@private
Wraps the provided error in a new error that includes the provided stack . Used to preserve stack traces across async calls . @private
function wrapError(err, stack) {
    if (typeof err === 'string') {
        throw err;
    }
    err.stack += '\nCaused by: ' + stack;
    return err;
}
function wrapError ( err , stack ) { if ( typeof err === 'string' ) { throw err ; } err . stack += '\nCaused by: ' + stack ; return err ; }
Wraps the provided error in a new error that includes the provided stack.
Wraps the provided error in a new error that includes the provided stack .
// TODO(b/157506412): Remove `string` type and clean up any string errors // that we are throwing.