diff --git a/packages/integration/src/gitlab/GitLabIntegration.ts b/packages/integration/src/gitlab/GitLabIntegration.ts index d76fd0e0cb..31b9bb1578 100644 --- a/packages/integration/src/gitlab/GitLabIntegration.ts +++ b/packages/integration/src/gitlab/GitLabIntegration.ts @@ -130,8 +130,8 @@ export class GitLabIntegration implements ScmIntegration { // Out of attempts: surface the response or rethrow the captured error if (attempt++ >= maxRetries) { - if (error) throw error; - return response!; + if (response) return response; + throw error; } // Determine delay from Retry-After header if present, otherwise exponential backoff