Fixing silent errors

Errors were not being propagated properly to the framework, they would get lost and never reach the error handler, which left the application in a zombie state. The connection was left open until the server was killed.

This PR fixes this issue.