Commit 9c13da41 authored by Mathieu Coupé's avatar Mathieu Coupé Committed by Pierre Smeyers
Browse files

fix: handle 409 conflict error as warnings

parent c1a68078
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -283,10 +283,16 @@ class Butler:
                    )

        except GitlabDeleteError as e:
            # ignore "409 Conflict: Resource lock" error, pipeline will be deleted on next run
            if e.response_code != 409:
                print(
                    f"{AnsiColors.BLUE}Error:{AnsiColors.RESET} failed to delete pipeline {pipeline.id} (ref: {AnsiColors.BLUE}{pipeline.ref}{AnsiColors.RESET}) : {e}"
                )
                self.handle_error(e)
            else:
                print(
                    f"{AnsiColors.BLUE}Warning:{AnsiColors.RESET} failed to delete pipeline {pipeline.id} (ref: {AnsiColors.BLUE}{pipeline.ref}{AnsiColors.RESET}) : {e}"
                )

    # Cleanup a GitLab project
    # $1: project to be cleaned