Open splix opened 10 months ago
Thanks for reporting. Could you run with debug logs enabled? Logs are stored in the log
directory. To generate debug logs, prepend the command line with LOG_LEVEL=DEBUG
, e.g.:
LOG_LEVEL=DEBUG rp2_us -o output -p crypto_example_ config/crypto_example.ini input/crypto_example.ods
Then open the log and check the end of it (probably the last line): it should give us clues as to what is happening. Before posting here any personal data please read this and feel free to sanitize your logs to skip sensitive info.
Turns out there were a zero value, but for a some reason LibreOffice wasn't able to find it. So it's not a RP2 bug.
So just to improve the situation, maybe it worth adding the line number to the error?
I tried something like that to ods_parser.py:125
:
try:
# Transaction line
_create_and_process_transaction(
configuration, row_values, current_table_type, i + 1, artificial_internal_id, unfiltered_transaction_sets, artificial_transaction_list
)
except RP2Error as exc:
raise RP2ValueError(f"{asset}({i + 1}): {exc}") from exc
It helped me to find the incorrect line. I see a similar catch in other lines, but not for _create_and_process_transaction
call, not sure what is the reason.
Glad you found the problem. Also what you suggest is a good improvement: can you open a PR? Thanks.
rp2_us
fails with error:I've checked the file and it doesn't have any line with zero value, but there are few lines with a very small value. That may be the reason, but anyway it's hard to find out where is the problem with such error message.
I suggest to include the actual string which rp2 failed to parse in the error message. And if it's possible the line number from the file.