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

No content with 400 and 500 responses #1369

Closed
kincsescsaba opened this issue May 11, 2021 · 2 comments
Closed

No content with 400 and 500 responses #1369

kincsescsaba opened this issue May 11, 2021 · 2 comments

Comments

@kincsescsaba
Copy link

Hi,

I created my custom BadRequest and InternalServerError responses for specific cases, I also pass the exception as a parameter but nothing is returned with the response, no content, it's empty.

What should I do if I want the details of the exception returned?

I tried the code below:

implicit val e: Encode.Aux[Exception, Text.Html] = Encode.instance((e, cs) =>
    Buf.Utf8(s"<h1>Bad thing happened: ${e.getMessage}<h1>")
  )

but it did not help, though I'm not sure where should I insert it to make things work.

Cheers,
Csaba

@joroKr21
Copy link
Collaborator

You need it when you call Bootstrap.toService or Bootstrap.listen.
But admittedly that's missing from the documentation.

@joroKr21
Copy link
Collaborator

I'm gonna use #1282 to track documenting this

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

No branches or pull requests

2 participants