Skip to content
Snippets Groups Projects
Commit 47b289f9 authored by michael.minelli's avatar michael.minelli
Browse files

GitlabManager => Remove filter on gitbeaker error status code

parent e1ffeb58
Branches
No related tags found
No related merge requests found
...@@ -4,7 +4,6 @@ import * as GitlabCore from '@gitbeaker/co ...@@ -4,7 +4,6 @@ import * as GitlabCore from '@gitbeaker/co
import { GitbeakerRequestError } from '@gitbeaker/requester-utils'; import { GitbeakerRequestError } from '@gitbeaker/requester-utils';
import { Gitlab, PipelineSchema, ProjectSchema, UserSchema } from '@gitbeaker/rest'; import { Gitlab, PipelineSchema, ProjectSchema, UserSchema } from '@gitbeaker/rest';
import GitlabToken from '../types/Gitlab/GitlabToken'; import GitlabToken from '../types/Gitlab/GitlabToken';
import { StatusCodes } from 'http-status-codes';
class SharedGitlabManager { class SharedGitlabManager {
...@@ -26,7 +25,7 @@ class SharedGitlabManager { ...@@ -26,7 +25,7 @@ class SharedGitlabManager {
try { try {
return await request(); return await request();
} catch ( error ) { } catch ( error ) {
if ( this.refreshTokenFunction && refreshTokenIfNeeded && error instanceof GitbeakerRequestError && error.cause?.response.status === StatusCodes.UNAUTHORIZED ) { if ( this.refreshTokenFunction && refreshTokenIfNeeded && error instanceof GitbeakerRequestError ) {
this.setToken(await this.refreshTokenFunction()); this.setToken(await this.refreshTokenFunction());
return this.executeGitlabRequest(request, false); return this.executeGitlabRequest(request, false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment