改进error request middleware