idig_check_error function

Check is the request returned an error.