fix request error handling

add error handling for error request.