Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance error message #159

Open
yellowbean opened this issue Mar 26, 2024 · 3 comments · Fixed by #158
Open

Enhance error message #159

yellowbean opened this issue Mar 26, 2024 · 3 comments · Fixed by #158

Comments

@yellowbean
Copy link
Owner

I've already include servant-errors

$ errorMwDefJson

But seems that if error was trigger by here:

mflowInterest _ = error "not supported"

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 yellowbean linked a pull request Mar 27, 2024 that will close this issue
@yellowbean yellowbean reopened this Apr 12, 2024
@yellowbean yellowbean linked a pull request Apr 13, 2024 that will close this issue
@yellowbean yellowbean removed a link to a pull request Apr 20, 2024
@yellowbean
Copy link
Owner Author

yellowbean commented Apr 26, 2024

Research by far:

  • Servant Checked-Exception -> it has to annotate all the function with envelop ,which will significantly change the code base.
  • Servant Exception -> Failed in example case in later. but it's good to have on validation on the API endpoint level

@yellowbean
Copy link
Owner Author

yellowbean commented May 1, 2024

haskell-servant/servant#1192

seems the issue hasn't been resolved.

@yellowbean
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant