Better error message when actor creation is attempted before ray.init() (#858)

This commit is contained in:
Eric Liang
2017-08-23 06:20:15 +02:00
committed by Robert Nishihara
parent e2f2a7e57a
commit c943ecaa42
+2 -1
View File
@@ -137,7 +137,8 @@ def fetch_and_register_actor(actor_class_key, worker):
def export_actor_class(class_id, Class, actor_method_names,
checkpoint_interval, worker):
if worker.mode is None:
raise NotImplemented("TODO(pcm): Cache actors")
raise Exception("Actors cannot be created before Ray has been "
"started. You can start Ray with 'ray.init()'.")
key = b"ActorClass:" + class_id
d = {"driver_id": worker.task_driver_id.id(),
"class_name": Class.__name__,