diff --git a/heudiconv/utils.py b/heudiconv/utils.py
index abea820..2453e9d 100644
--- a/heudiconv/utils.py
+++ b/heudiconv/utils.py
@@ -19,6 +19,11 @@ from nipype.utils.filemanip import which
 import logging
 lgr = logging.getLogger(__name__)
 
+if sys.version_info[0] > 2:
+    from json.decoder import JSONDecodeError
+else:
+    JSONDecodeError = ValueError
+
 
 seqinfo_fields = [
     'total_files_till_now',  # 0
@@ -172,10 +177,15 @@ def load_json(filename):
     -------
     data : dict
     """
-    with open(filename, 'r') as fp:
-        data = json.load(fp)
-    return data
+    try:
+        with open(filename, 'r') as fp:
+            data = json.load(fp)
+    except JSONDecodeError:
+        lgr.error("{fname} is not a valid json file".format(fname=filename))
+        raise
 
+    return data
+    
 
 def assure_no_file_exists(path):
     """Check if file or symlink (git-annex?) exists, and if so -- remove"""

enhance explicitness about what json files heudiconv fails to read
<!-- DO NOT DELETE THIS! 
This template is used to facilitate issue resolution.
All text in <!-> tags will not be displayed.
-->

### Summary
I was helping a user troubleshoot a problem with heudiconv, as it was tripping up on an invalid json file, but the user only thought heudiconv was touching files in the subject directory inside the bids directory, and not looking in other places inside the bids directory (which it does).

A clue that could have gotten this user on track faster would be to print which file was the invalid json file.

To help, the `load_json` function could be changed to something like:

```
try:
    with open(filename, 'r') as fp:
            data = json.load(fp)
except json.JSONDecodeError:
    print("{fname} is not a valid json file".format(fname=filename)
    raise
```
Thoughts on this?
If positive I can open a pull request.
<!-- If you are having conversion troubles, please share as much
relevant information as possible. This includes, but is not limited to:
- log of conversion
- heuristic
-->



### Platform details:

Choose one:
- [ ] Local environment
<!-- If selected, please provide OS and python version -->
- [x] Container
<!-- If selected, please provide container name and tag"-->

- Heudiconv version: 0.5.4
<!-- To check: run heudiconv with just the --version flag -->


diff --git a/heudiconv/tests/test_utils.py b/heudiconv/tests/test_utils.py
index 47faec4..ad84673 100644
--- a/heudiconv/tests/test_utils.py
+++ b/heudiconv/tests/test_utils.py
@@ -1,10 +1,16 @@
+import json
 import os
 import os.path as op
+
 from heudiconv.utils import (
     get_known_heuristics_with_descriptions,
     get_heuristic_description,
     load_heuristic,
-    json_dumps_pretty)
+    json_dumps_pretty,
+    load_json,
+    create_tree,
+    save_json,
+    JSONDecodeError)
 
 import pytest
 from .utils import HEURISTICS_PATH
@@ -58,4 +64,24 @@ def test_json_dumps_pretty():
           'Mar  3 2017 10:46:13 by eja'
     # just the date which reveals the issue
     # tstr = 'Mar  3 2017 10:46:13 by eja'
-    assert pretty({'WipMemBlock': tstr}) == '{\n  "WipMemBlock": "%s"\n}' % tstr
\ No newline at end of file
+    assert pretty({'WipMemBlock': tstr}) == '{\n  "WipMemBlock": "%s"\n}' % tstr
+
+
+def test_load_json(tmp_path, caplog):
+    # test invalid json
+    ifname = 'invalid.json'
+    invalid_json_file = str(tmp_path / ifname)
+    create_tree(str(tmp_path), {ifname: u"I'm Jason Bourne"})
+
+    with pytest.raises(JSONDecodeError):
+        load_json(str(invalid_json_file))
+
+    assert ifname in caplog.text
+
+    # test valid json
+    vcontent = {"secret": "spy"}
+    vfname = "valid.json"
+    valid_json_file = str(tmp_path / vfname)
+    save_json(valid_json_file, vcontent)
+    
+    assert load_json(valid_json_file) == vcontent

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest tinydb requests
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
annexremote==1.6.6
appdirs==1.4.4
attrs==22.2.0
boto==2.49.0
certifi==2021.5.30
cffi==1.15.1
chardet==5.0.0
charset-normalizer==2.0.12
ci-info==0.2.0
click==8.0.4
cryptography==40.0.2
datalad==0.15.6
dcmstack==0.9.0
decorator==4.4.2
Deprecated==1.2.18
etelemetry==0.2.2
fasteners==0.19
filelock==3.4.1
-e git+https://github.com/nipy/heudiconv.git@d31d19d6904d59ca407f5899e405f6de4ba7d00f#egg=heudiconv
humanize==3.14.0
idna==3.10
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
inotify==0.2.10
iso8601==1.1.0
isodate==0.6.1
jeepney==0.7.1
keyring==23.4.1
keyrings.alt==4.1.0
lxml==5.3.1
mock==5.2.0
msgpack==1.0.5
networkx==2.5.1
nibabel==3.2.2
nipype==1.7.1
nose==1.3.7
numpy==1.19.5
packaging==21.3
pathlib==1.0.1
patool==1.12
pluggy==1.0.0
prov==2.0.1
py==1.11.0
pycparser==2.21
pydicom==2.3.1
pydot==1.4.2
PyGithub==1.56
PyJWT==2.4.0
PyNaCl==1.5.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
python-gitlab==2.10.1
rdflib==5.0.0
requests==2.27.1
requests-toolbelt==1.0.0
scipy==1.5.4
SecretStorage==3.3.3
simplejson==3.20.1
six==1.17.0
swebench-matterhorn @ file:///swebench_matterhorn
tinydb==4.7.0
tomli==1.2.3
tqdm==4.64.1
traits==6.4.1
typing_extensions==4.1.1
urllib3==1.26.20
Whoosh==2.7.4
wrapt==1.16.0
zipp==3.6.0

name: heudiconv
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - annexremote==1.6.6
      - appdirs==1.4.4
      - attrs==22.2.0
      - boto==2.49.0
      - cffi==1.15.1
      - chardet==5.0.0
      - charset-normalizer==2.0.12
      - ci-info==0.2.0
      - click==8.0.4
      - cryptography==40.0.2
      - datalad==0.15.6
      - dcmstack==0.9.0
      - decorator==4.4.2
      - deprecated==1.2.18
      - etelemetry==0.2.2
      - fasteners==0.19
      - filelock==3.4.1
      - humanize==3.14.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - inotify==0.2.10
      - iso8601==1.1.0
      - isodate==0.6.1
      - jeepney==0.7.1
      - keyring==23.4.1
      - keyrings-alt==4.1.0
      - lxml==5.3.1
      - mock==5.2.0
      - msgpack==1.0.5
      - networkx==2.5.1
      - nibabel==3.2.2
      - nipype==1.7.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pathlib==1.0.1
      - patool==1.12
      - pluggy==1.0.0
      - prov==2.0.1
      - py==1.11.0
      - pycparser==2.21
      - pydicom==2.3.1
      - pydot==1.4.2
      - pygithub==1.56
      - pyjwt==2.4.0
      - pynacl==1.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - python-gitlab==2.10.1
      - rdflib==5.0.0
      - requests==2.27.1
      - requests-toolbelt==1.0.0
      - scipy==1.5.4
      - secretstorage==3.3.3
      - simplejson==3.20.1
      - six==1.17.0
      - swebench-matterhorn==0.0.0
      - tinydb==4.7.0
      - tomli==1.2.3
      - tqdm==4.64.1
      - traits==6.4.1
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - whoosh==2.7.4
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/heudiconv

heudiconv/tests/test_utils.py::test_get_known_heuristics_with_descriptions heudiconv/tests/test_utils.py::test_get_heuristic_description heudiconv/tests/test_utils.py::test_load_heuristic heudiconv/tests/test_utils.py::test_json_dumps_pretty heudiconv/tests/test_utils.py::test_load_json
heudiconv/utils.py
heudiconv/utils.py