lib: error' now adds an Error: prefix

This commit is contained in:
Simon Michael 2022-04-21 23:55:40 -10:00
parent 0d232ed673
commit f47d423a67
5 changed files with 9 additions and 9 deletions

View File

@ -252,7 +252,7 @@ numDigitsInt n
-- | Simpler alias for errorWithoutStackTrace -- | Simpler alias for errorWithoutStackTrace
error' :: String -> a error' :: String -> a
error' = errorWithoutStackTrace error' = errorWithoutStackTrace . ("Error: " <>)
-- | A version of errorWithoutStackTrace that adds a usage hint. -- | A version of errorWithoutStackTrace that adds a usage hint.
usageError :: String -> a usageError :: String -> a

View File

@ -774,7 +774,7 @@ if|account2|comment
%description Flubber|acct| %description Flubber|acct|
$ ./csvtest.sh $ ./csvtest.sh
>2 >2
hledger: input.rules:6:1: hledger: Error: input.rules:6:1:
| |
6 | %amount 150|acct2 6 | %amount 150|acct2
| ^ | ^
@ -796,7 +796,7 @@ account2 acct
comment cmt comment cmt
$ ./csvtest.sh $ ./csvtest.sh
>2 >2
hledger: input.rules:5:1: hledger: Error: input.rules:5:1:
| |
5 | if Flubber 5 | if Flubber
| ^ | ^
@ -822,7 +822,7 @@ if Flubber
account2 %myaccount2 account2 %myaccount2
$ ./csvtest.sh $ ./csvtest.sh
>2 >2
hledger: input.rules:6:3: hledger: Error: input.rules:6:3:
| |
6 | myaccount2 acct 6 | myaccount2 acct
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
@ -870,7 +870,7 @@ if account2 comment
%description Flubber acct %description Flubber acct
$ ./csvtest.sh $ ./csvtest.sh
>2 >2
hledger: input.rules:5:1: hledger: Error: input.rules:5:1:
| |
5 | if account2 comment 5 | if account2 comment
| ^ | ^

View File

@ -172,7 +172,7 @@ Balance changes in 2016-10-01..2017-01-31:
$ hledger bal -M -b 2016-10 -e 2017-02 -f - --forecast=20160801-foobar $ hledger bal -M -b 2016-10 -e 2017-02 -f - --forecast=20160801-foobar
> >
>2 >2
hledger: could not parse forecast period : 1:10: hledger: Error: could not parse forecast period : 1:10:
| |
1 | 20160801-foobar 1 | 20160801-foobar
| ^ | ^

View File

@ -8,7 +8,7 @@
# 1. # 1.
$ hledger -f - print $ hledger -f - print
>2 >2
hledger: -:1:5: hledger: Error: -:1:5:
| |
1 | 2018 1 | 2018
| ^ | ^
@ -123,7 +123,7 @@ $ hledger -f- print
b 1B b 1B
$ hledger -f- print $ hledger -f- print
>2 >2
hledger: -:1-3 hledger: Error: -:1-3
could not balance this transaction: could not balance this transaction:
real postings all have the same sign real postings all have the same sign
2020-01-01 2020-01-01

View File

@ -238,7 +238,7 @@ hledger -f- roi -p 2019-11 --inv Investment --pnl PnL
Assets:Checking 101 A Assets:Checking 101 A
Unrealized PnL Unrealized PnL
>>>2 >>>2
hledger: Amounts could not be converted to a single cost basis: ["10 B","-10 B @@ 100 A"] hledger: Error: Amounts could not be converted to a single cost basis: ["10 B","-10 B @@ 100 A"]
Consider using --value to force all costs to be in a single commodity. Consider using --value to force all costs to be in a single commodity.
For example, "--cost --value=end,<commodity> --infer-market-prices", where commodity is the one that was used to pay for the investment. For example, "--cost --value=end,<commodity> --infer-market-prices", where commodity is the one that was used to pay for the investment.
>>>=1 >>>=1