rawhat / mist

gleam HTTP server. because it glistens on a web
Apache License 2.0
260 stars 11 forks source link

Return 500 and a body when the application crashes #4

Closed lpil closed 2 years ago

lpil commented 2 years ago

Hello!

Currently when the web handler crashes the connection is closed. I think we would want to instead return 500 and a body, perhaps Internal server error.

We would also want to ensure that the error is logged using the Erlang logger.

rawhat commented 2 years ago

Wrapped the call to the HTTP handler in a gleam/erlang.{rescue} 🎉

Also added a super small wrapper around the logger:error method. Works in the interim, until we decide on anything more robust!

lpil commented 2 years ago

Brill, thank you