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.
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 errorWe may need to check and see if the response has been closed before having the error handler try to give a response.