diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 2354fcedcc8a6fad8bb66f566ca6f33089180d7b..17c8e703091f444160ad31a4848339cd77ff3b8d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,21 +4,21 @@ exclude: "^$"
 fail_fast: false
 repos:
   - repo: https://github.com/PyCQA/flake8
-    rev: 6.1.0
+    rev: 7.1.1
     hooks:
       - id: flake8
         additional_dependencies:
           [flake8-docstrings, flake8-debugger, flake8-bugbear, mccabe]
         args: [--max-complexity, "10", --ignore, "C901,E501"]
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v3.2.0
+    rev: v4.6.0
     hooks:
       - id: trailing-whitespace
       - id: end-of-file-fixer
       - id: check-yaml
       - id: check-added-large-files
   - repo: https://github.com/pycqa/isort
-    rev: 5.12.0
+    rev: 5.13.2
     hooks:
       - id: isort
         language_version: python3
@@ -33,7 +33,7 @@ repos:
   #         - types-requests
   #       args: ["--python-version", "3.8", "--ignore-missing-imports"]
   - repo: https://github.com/psf/black
-    rev: 23.7.0 # Replace by any tag/version: https://github.com/psf/black/tags
+    rev: 24.8.0 # Replace by any tag/version: https://github.com/psf/black/tags
     hooks:
       - id: black
         language_version: python3 # Should be a command that runs python3.6+
diff --git a/mvcm/spectral_tests.py b/mvcm/spectral_tests.py
index e5fb9a6ec6c72ddc97905d1bb6919616fe4eaa21..6c6a8389e51df76033e5fcdfb8dcb17f02ec5480 100644
--- a/mvcm/spectral_tests.py
+++ b/mvcm/spectral_tests.py
@@ -141,7 +141,8 @@ class CloudTests:
             idx = np.nonzero((rad >= thr) & (self.data[self.scene_name].values[scene_idx] == 1))
 
         if idx is None:
-            ValueError("Something went wrong and idx is not defined.")
+            errstr = "Something went wrong and idx is not defined."
+            raise ValueError(errstr)
 
         test_bits = np.zeros(rad.shape)
         test_bits[idx] = 1