@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.
@@ -5140,24 +5140,22 @@ class AuthService extends BaseApiService {
5140
5140
  */
5141
5141
  __publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
5142
5142
  const uuid = v4();
5143
- try {
5144
- const responsePromise = this.enqueueRequest({
5145
- uuid,
5146
- description: "Get token pair",
5147
- method: HttpMethod.POST,
5148
- url: "/api/token/",
5149
- payload: credentials,
5150
- isAuthNeeded: false,
5151
- blockers: [],
5152
- blocks: []
5153
- });
5154
- return [responsePromise.then(parseTokens), uuid];
5155
- } catch (e) {
5143
+ const responsePromise = this.enqueueRequest({
5144
+ uuid,
5145
+ description: "Get token pair",
5146
+ method: HttpMethod.POST,
5147
+ url: "/api/token/",
5148
+ payload: credentials,
5149
+ isAuthNeeded: false,
5150
+ blockers: [],
5151
+ blocks: []
5152
+ }).then(parseTokens).catch((e) => {
5156
5153
  if (logoutOnFailure) {
5157
5154
  void this.logout().then();
5158
5155
  }
5159
5156
  throw e;
5160
- }
5157
+ });
5158
+ return [responsePromise, uuid];
5161
5159
  });
5162
5160
  /**
5163
5161
  * Takes refresh token and gets a new token pair
@@ -5218,7 +5216,7 @@ class AuthService extends BaseApiService {
5218
5216
  timedOut = true;
5219
5217
  store.dispatch(markForDeletion(uuid));
5220
5218
  store.dispatch(markForDeletion(initialDataUuid));
5221
- reject(new Error(`Request timed out after ${timeout} seconds`));
5219
+ reject(new APIError({ message: `Request timed out after ${timeout} seconds` }));
5222
5220
  }, timeout * 1e3);
5223
5221
  });
5224
5222
  const successPromise = promise.then((tokens) => {