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

IO::Error Headers already sent #1777

Open
jwoertink opened this issue Jan 19, 2023 · 0 comments
Open

IO::Error Headers already sent #1777

jwoertink opened this issue Jan 19, 2023 · 0 comments
Labels

Comments

@jwoertink
Copy link
Member

If a bug happens when calling response.print(body) from the TextResponse, then the ErrorHandler will try to do the same thing. This causes this error

  IO::Error 

     Headers already sent

    Backtrace 

     /usr/share/crystal/src/gc/boehm.cr:129:5 in 'print'
     /usr/share/crystal/src/gc/boehm.cr:129:5 in 'call_error_action'
     lib/lucky/src/lucky/error_handler.cr:16:5 in 'call'
     /usr/share/crystal/src/http/server/request_processor.cr:51:11 in 'process'
     /usr/share/crystal/src/http/server.cr:500:5 in '->'
     /usr/share/crystal/src/fiber.cr:146:11 in 'run'
     ???

We may need to check and see if the response has been closed before having the error handler try to give a response.

@jwoertink jwoertink added the bug label Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant