Skip to content

Commit

Permalink
fix: 🐛 error message fix on refresh token error
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeem-cs committed Oct 11, 2023
1 parent c6daba3 commit 0abd950
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 319 deletions.
6 changes: 3 additions & 3 deletions lib/core/concurrency-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ export function ConcurrencyQueue ({ axios, config }) {
axios.httpClientParams.headers.authtoken = token.authtoken
this.config.authtoken = token.authtoken
}
}).catch(() => {
}).catch((error) => {
this.queue.forEach(queueItem => {
queueItem.reject({
errorCode: '401',
errorMessage: 'Unable to refresh token',
errorMessage: (error instanceof Error) ? error.message : error,
code: 'Unauthorized',
message: 'Request failed with status code 401',
message: 'Unable to refresh token',
name: 'Token Error',
config: queueItem.request
})
Expand Down
2 changes: 0 additions & 2 deletions lib/stack/roles/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import cloneDeep from 'lodash/cloneDeep'
import { create, update, deleteEntity, fetch, query, fetchAll } from '../../entity'
import ContentstackCollection from '../../contentstackCollection'
import error from '../../core/contentstackError'
/**
* A role is a collection of permissions that will be applicable to all the users who are assigned this role. Read more about <a href= 'https://www.contentstack.com/docs/guide/users-and-roles#roles'>Roles</a>.
* @namespace Role
Expand Down
Loading

0 comments on commit 0abd950

Please sign in to comment.