@firebase/firestore 3.7.1 → 3.7.2-canary.457fc2eeb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
14
14
 
15
15
  var nodeFetch__default = /*#__PURE__*/_interopDefaultLegacy(nodeFetch);
16
16
 
17
- const version$1 = "3.7.1";
17
+ const version$1 = "3.7.2-canary.457fc2eeb";
18
18
 
19
19
  /**
20
20
  * @license
@@ -67,7 +67,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
67
67
  User.FIRST_PARTY = new User('first-party-uid');
68
68
  User.MOCK_USER = new User('mock-user');
69
69
 
70
- const version = "9.12.1";
70
+ const version = "9.13.0-canary.457fc2eeb";
71
71
 
72
72
  /**
73
73
  * @license
@@ -1468,6 +1468,7 @@ class FetchConnection extends RestConnection {
1468
1468
  throw new Error('Not supported by FetchConnection');
1469
1469
  }
1470
1470
  async performRPCRequest(rpcName, url, headers, body) {
1471
+ var _a;
1471
1472
  const requestJson = JSON.stringify(body);
1472
1473
  let response;
1473
1474
  try {
@@ -1481,7 +1482,12 @@ class FetchConnection extends RestConnection {
1481
1482
  throw new FirestoreError(mapCodeFromHttpStatus(err.status), 'Request failed with error: ' + err.statusText);
1482
1483
  }
1483
1484
  if (!response.ok) {
1484
- throw new FirestoreError(mapCodeFromHttpStatus(response.status), 'Request failed with error: ' + response.statusText);
1485
+ let errorResponse = await response.json();
1486
+ if (Array.isArray(errorResponse)) {
1487
+ errorResponse = errorResponse[0];
1488
+ }
1489
+ const errorMessage = (_a = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _a === void 0 ? void 0 : _a.message;
1490
+ throw new FirestoreError(mapCodeFromHttpStatus(response.status), `Request failed with error: ${errorMessage !== null && errorMessage !== void 0 ? errorMessage : response.statusText}`);
1485
1491
  }
1486
1492
  return response.json();
1487
1493
  }
@@ -8139,6 +8145,7 @@ class TransactionRunner {
8139
8145
  const code = error.code;
8140
8146
  return (code === 'aborted' ||
8141
8147
  code === 'failed-precondition' ||
8148
+ code === 'already-exists' ||
8142
8149
  !isPermanentError(code));
8143
8150
  }
8144
8151
  return false;