par-tec / super-sast

A docker container with different testing tools.
BSD 3-Clause "New" or "Revised" License
12 stars 3 forks source link

Log context information on error/exception #27

Closed ioggstream closed 1 year ago

ioggstream commented 1 year ago

I expect

instead

For example, in the following trace I don't know the current username, uid, gid and the directory permissions.

2023-01-21T15:11:06 INFO Copying java validators to /home/user/.m2
Traceback (most recent call last):
  File "/entrypoint.py", line 336, in <module>
    _copy_java_validators()
  File "/entrypoint.py", line 301, in _copy_java_validators
    copytree("/app/java-validators/.m2", m2_home)
  File "/usr/local/lib/python3.11/shutil.py", line 561, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/shutil.py", line 459, in _copytree
    os.makedirs(dst, exist_ok=dirs_exist_ok)
  File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/home/user/.m2'
ioggstream commented 1 year ago

cc: @nocturn9x

nocturn9x commented 1 year ago

Could you clarify what you mean by "context information" in this instance?

ioggstream commented 1 year ago

@nocturn9x which is the username, uid, gid, directory permissions and all the other information useful to troubleshoot the issue.