Catch errors from connection handler

so it doesn't crash the whole server