More robust check of handled errors.