egh / ledger-autosync

Synchronize your ledger-cli files with your bank.
GNU General Public License v3.0
273 stars 42 forks source link

When hledger not in path, get stack instead of error message. #8

Closed daniel-vainsencher closed 8 years ago

daniel-vainsencher commented 8 years ago

The following is not easy to decipher:

Traceback (most recent call last): File "/usr/bin/hledger-autosync", line 11, in load_entry_point('ledger-autosync==0.2.5', 'console_scripts', 'hledger-autosync')() File "/usr/lib/python2.7/site-packages/ledgerautosync/cli.py", line 199, in run import_csv(ledger, args) File "/usr/lib/python2.7/site-packages/ledgerautosync/cli.py", line 109, in import_csv for txn in sync.parse_file(args.PATH, accountname=args.account): File "/usr/lib/python2.7/site-packages/ledgerautosync/sync.py", line 132, in parse_file "csvid", converter.get_csv_id(row)))] File "/usr/lib/python2.7/site-packages/ledgerautosync/ledgerwrap.py", line 227, in check_transaction_by_id return self.run(cmd) != '' File "/usr/lib/python2.7/site-packages/ledgerautosync/ledgerwrap.py", line 223, in run return subprocess.check_output(cmd) File "/usr/lib/python2.7/subprocess.py", line 567, in check_output process = Popen(stdout=PIPE, _popenargs, *_kwargs) File "/usr/lib/python2.7/subprocess.py", line 711, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

egh commented 8 years ago

To be fair you are calling hledger-autosync, I believe? If you call ledger-autosync and there is no ledger or hledger in your path you get a better error message.

daniel-vainsencher commented 8 years ago

You are right, I am calling hledger-autosync. Does it get less testing?

egh commented 8 years ago

No, it's not so much that, it's that hledger-autosync is just an alias that bypasses the usual checks for which ledger version to use that ledger-autosync uses.

Still, it should give a better error message if hledger is not in the PATH. I'll fix it.

Thanks for taking the time to report this!

egh commented 8 years ago

Fixed in https://github.com/egh/ledger-autosync/commit/9877a70d67de758aa0528588a5a1da2e7b857781. Thanks again!

daniel-vainsencher commented 8 years ago

Thank you!

On Wed, Oct 12, 2016 at 5:39 AM, Erik Hetzner notifications@github.com wrote:

Fixed in 9877a70 https://github.com/egh/ledger-autosync/commit/9877a70d67de758aa0528588a5a1da2e7b857781. Thanks again!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/egh/ledger-autosync/issues/8#issuecomment-253103576, or mute the thread https://github.com/notifications/unsubscribe-auth/ABcrVgsGn8pQsNMxgajavgnHzwGiuIOEks5qzEhOgaJpZM4KSgPO .