karlicoss / promnesia

Another piece of your extended mind
https://beepb00p.xyz/promnesia.html
MIT License
1.74k stars 74 forks source link

enh: log tracebacks of collected source-errors to aid debugging #334

Closed ankostis closed 1 year ago

ankostis commented 2 years ago

Without it, logs don't reveal the actual place of the error produced from some SOURCE:

[ERROR   2022-09-14 10:46:05 promnesia __main__.py:99] 1 errors, printing them out:
[ERROR   2022-09-14 10:46:05 promnesia __main__.py:101]     'ModuleNotFoundError' object has no attribute 'norm_url'

Now it becomes like that:

[ERROR   2022-09-14 12:20:48 promnesia __main__.py:99] 1 errors, printing them out:
[ERROR   2022-09-14 12:20:48 promnesia __main__.py:101]     'ModuleNotFoundError' object has no attribute 'norm_url'
    Traceback (most recent call last):
      File ".../promnesia.git/src/promnesia/__main__.py", line 57, in iter_all_visits
        yield from hook(v)
      File "~/.config/promnesia/config.py", line 116, in HOOK
        if "github.com" in v.norm_url:
    AttributeError: 'ModuleNotFoundError' object has no attribute 'norm_url'
karlicoss commented 1 year ago

:eyes: thanks, this looks pretty useful -- didn't know about exc_info argument! sorry didn't review it for so long, was super busy