@overmap-ai/core 1.0.49-fix-error-messaging.1 → 1.0.49-fix-error-messaging.2

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.
@@ -5131,24 +5131,22 @@ var __publicField = (obj, key, value) => {
5131
5131
  */
5132
5132
  __publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
5133
5133
  const uuid$1 = uuid.v4();
5134
- try {
5135
- const responsePromise = this.enqueueRequest({
5136
- uuid: uuid$1,
5137
- description: "Get token pair",
5138
- method: HttpMethod.POST,
5139
- url: "/api/token/",
5140
- payload: credentials,
5141
- isAuthNeeded: false,
5142
- blockers: [],
5143
- blocks: []
5144
- });
5145
- return [responsePromise.then(parseTokens), uuid$1];
5146
- } catch (e) {
5134
+ const responsePromise = this.enqueueRequest({
5135
+ uuid: uuid$1,
5136
+ description: "Get token pair",
5137
+ method: HttpMethod.POST,
5138
+ url: "/api/token/",
5139
+ payload: credentials,
5140
+ isAuthNeeded: false,
5141
+ blockers: [],
5142
+ blocks: []
5143
+ }).then(parseTokens).catch((e) => {
5147
5144
  if (logoutOnFailure) {
5148
5145
  void this.logout().then();
5149
5146
  }
5150
5147
  throw e;
5151
- }
5148
+ });
5149
+ return [responsePromise, uuid$1];
5152
5150
  });
5153
5151
  /**
5154
5152
  * Takes refresh token and gets a new token pair
@@ -5209,7 +5207,7 @@ var __publicField = (obj, key, value) => {
5209
5207
  timedOut = true;
5210
5208
  store.dispatch(markForDeletion(uuid$1));
5211
5209
  store.dispatch(markForDeletion(initialDataUuid));
5212
- reject(new Error(`Request timed out after ${timeout} seconds`));
5210
+ reject(new APIError({ message: `Request timed out after ${timeout} seconds` }));
5213
5211
  }, timeout * 1e3);
5214
5212
  });
5215
5213
  const successPromise = promise.then((tokens) => {