ananthakumaran / paisa

Paisa – Personal Finance Manager. https://paisa.fyi demo: https://demo.paisa.fyi
https://paisa.fyi
GNU Affero General Public License v3.0
2.4k stars 124 forks source link

Improve error message #268

Open pashagolub opened 4 weeks ago

pashagolub commented 4 weeks ago

The error message is not helpful at all:

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
ananthakumaran commented 4 weeks ago

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.

pashagolub commented 4 weeks ago

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 :)