fix: udate if statement in catch block to account for new version of gitbeaker
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com> fix: udate if statement in catch block to account for new version of gitbeaker
This commit is contained in:
@@ -643,8 +643,10 @@ describe('publish:gitlab', () => {
|
||||
|
||||
it('should show proper error message when token has insufficient permissions or namespace not found', async () => {
|
||||
mockGitlabClient.Namespaces.show.mockRejectedValue({
|
||||
response: {
|
||||
statusCode: 404,
|
||||
cause: {
|
||||
response: {
|
||||
status: 404,
|
||||
},
|
||||
},
|
||||
});
|
||||
const owner = 'infrastructure/devex';
|
||||
|
||||
@@ -387,7 +387,7 @@ export function createPublishGitlabAction(options: {
|
||||
|
||||
targetNamespaceId = namespaceResponse.id;
|
||||
} catch (e) {
|
||||
if (e.response && e.response.statusCode === 404) {
|
||||
if (e.cause?.response?.status === 404) {
|
||||
throw new InputError(
|
||||
`The namespace ${owner} is not found or the user doesn't have permissions to access it`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user