From 095a72e92d83013a0cb3fe6eabed11d9718a1539 Mon Sep 17 00:00:00 2001
From: Gokhan Ozbulak <gokhan.ozbulak@idiap.ch>
Date: Tue, 23 Apr 2024 22:15:57 +0200
Subject: [PATCH] Remove try/catch block for auth, no need it #60.

---
 src/mednet/scripts/upload.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mednet/scripts/upload.py b/src/mednet/scripts/upload.py
index ec2ba7b2..bed4802f 100644
--- a/src/mednet/scripts/upload.py
+++ b/src/mednet/scripts/upload.py
@@ -32,14 +32,8 @@ def _get_gitlab_config():
         token = input(f"{server} (user or project) token: ")
         gl = gitlab.Gitlab(server, private_token=token, api_version="4")
         config = {"idiap": {"private_token": token}}
-    # try to authenticate with given credential.
-    try:
-        gl.auth()
-    except:
-        logger.error("Gitlab credential issue, authentication failed.")
-        raise RuntimeError(
-            f"There is a Gitlab credential issue that must be fixed before uploading."
-        )
+    # test authentication with given credential.
+    gl.auth()
 
     return gl, config
 
-- 
GitLab