Just pass the error message to on_error()

Fix not triggering end()