yellowbean / Hastructure

ABS/MBS cashflow engine written in Haskell, with API to Python and C/Java (on the way)
https://deal-bench.xyz
Other
15 stars 4 forks source link

Enhance error message #159

Open yellowbean opened 5 months ago

yellowbean commented 5 months ago

I've already include servant-errors

https://github.com/yellowbean/Hastructure/blob/d813a25fc82b13538d0e1ba4a032d33de9ffffcb/app/Main.hs#L453

But seems that if error was trigger by here: https://github.com/yellowbean/Hastructure/blob/d813a25fc82b13538d0e1ba4a032d33de9ffffcb/src/Cashflow.hs#L511

the error "xxxxx" isn't convert into a json response like :

{"status":xxx
 "message":"xxxxxx"}

Screenshot 2024-03-27 at 02 14 16

from the python/request , a remoteDisconnected was raised.

Screenshot 2024-03-27 at 02 16 54

yellowbean commented 4 months ago

Research by far:

yellowbean commented 4 months ago

https://github.com/haskell-servant/servant/issues/1192

seems the issue hasn't been resolved.

yellowbean commented 2 weeks ago

The last resort will be create a new api endpoints with response type include a error message