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:
Cory Steers
2025-03-03 14:27:11 -06:00
parent 753c1a1c78
commit d7fe7f0a99
2 changed files with 5 additions and 3 deletions
@@ -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`,
);