From e4cd14a0fccaada8596c4f2437b210080b179a12 Mon Sep 17 00:00:00 2001 From: Adam Talbot Date: Tue, 2 May 2023 11:48:27 +0100 Subject: [PATCH] More explicit errors regarding connecting to container URLs --- nf_core/modules/lint/main_nf.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index 3a86e0f314..5c33d034c3 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -332,13 +332,23 @@ def check_process_section(self, lines, fix_version, progress_bar): self.failed.append(("container_links", "Unable to connect to container URL", self.main_nf)) continue if not response.ok: - self.warned.append( - ( - "container_links", - f"Access to container {response.url} denied, status code: {response.status_code}", - self.main_nf, + if response.status_code in [400, 401, 402, 403]: + self.warned.append( + ( + "container_links", + f"Access to container {response.url} denied, status code: {response.status_code}", + self.main_nf, + ) + ) + + else: + self.failed.append( + ( + "container_links", + f"Unable to connect to {response.url}, status code: {response.status_code}", + self.main_nf, + ) ) - ) # Check that all bioconda packages have build numbers # Also check for newer versions