jello icon indicating copy to clipboard operation
jello copied to clipboard

Error messages / exceptions sometimes hard to pinpoint to source (missing line numbers)

Open g-v-egidy opened this issue 1 year ago • 1 comments

I already mentioned this in https://github.com/kellyjonbrazil/jello/discussions/57#discussioncomment-5716128 and now wanted to back this up with a proper example.

So with most python exceptions occurring within jello I find it hard to pinpoint them to the part of the query source they come from. My main issue is that they don't show any line number.

For example here:

# jc -a | jello "ret=_['version']['not a dict error']; ret"
jello:  Query Exception:  TypeError
        string indices must be integers
        query:  ret=_['version']['not a dict error']; ret
        data:  {'name': 'jc', 'version': '1.23.1', 'description': 'JSON Convert', 'author': 'Kelly Brazil', 'author_email': '[email protected]', 'website':
            'https://github.com/kellyjonbrazil/jc', 'copyrig ... tus` command parser', 'author': 'Kelly Brazil', 'author_email': '[email protected]', 'compatible': ['linux', 'darwin',
            'freebsd'], 'tags': ['command'], 'magic_commands': ['zpool status']}]}

Now this is of course a minimal example with just one line. But consider you have like 10 or 20 lines of code there. Then line numbers in the error message would really help.

g-v-egidy avatar May 13 '23 14:05 g-v-egidy