error message is present in res variable