Raise an exception if the resource_name is not defined