Skip to content

Commit 7bdbea8

Browse files
committed
fix: 🐛 error message fix on refresh token error
1 parent 3aaa883 commit 7bdbea8

File tree

3 files changed

+337
-319
lines changed

3 files changed

+337
-319
lines changed

lib/core/concurrency-queue.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ export function ConcurrencyQueue ({ axios, config }) {
147147
axios.httpClientParams.headers.authtoken = token.authtoken
148148
this.config.authtoken = token.authtoken
149149
}
150-
}).catch(() => {
150+
}).catch((error) => {
151151
this.queue.forEach(queueItem => {
152152
queueItem.reject({
153153
errorCode: '401',
154-
errorMessage: 'Unable to refresh token',
154+
errorMessage: (error instanceof Error) ? error.message : error,
155155
code: 'Unauthorized',
156-
message: 'Request failed with status code 401',
156+
message: 'Unable to refresh token',
157157
name: 'Token Error',
158158
config: queueItem.request
159159
})

lib/stack/roles/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import cloneDeep from 'lodash/cloneDeep'
22
import { create, update, deleteEntity, fetch, query, fetchAll } from '../../entity'
3-
import ContentstackCollection from '../../contentstackCollection'
4-
import error from '../../core/contentstackError'
53
/**
64
* 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>.
75
* @namespace Role

0 commit comments

Comments
 (0)