Handling request error

Without this fix, I couldn't catch "socket hang up" errors.