ananthakumaran/paisa

Improve error message

Opened this issue · 2 comments

The error message is not helpful at all:

  • it doesn't tell you where to look for an error
  • it disappears immediately not letting you to copy-paste anything to grep files

image

If I run ledger it's output allows me to find the error easily:

./ledger -f main.ledger
In file included from "main.ledger", line 40:
While parsing file "2024\24-08.ledger", line 71:
While balancing transaction from "2024\24-08.ledger", lines 63-71:
> 2024/08/02 -----------------------------------------------
> 2024/08/02  Transaction description
>     Expenses:foobaz                                40.00 EUR
>     Expenses:foobaz                                20.00 EUR
>     Expenses:foobaz                                20.00 EUR
>     Expenses:foobaz                                20.00 EUR
>     Assets:Checking:Bank1                         -60.00 EUR
>     Assets:Checking:Bank2                         -20.0
Unbalanced remainder is:
           20.00 EUR
Amount to balance against:
          100.00 EUR
Error: Transaction does not balance

I am assuming this because you are looking at the main.ledger file instead of the ledger file that had the actual error? In the latter case, the error would be shown at the editor level.

The error is shown when I'm trying to sync. But if I'm opening editor with main.ledger it doesn't show the error, you're right. And if I am trying to open the exact file, it cannot parse it because it depends on account definitions in the main.ledger :)