@@ -32,10 +32,13 @@ def __init__(self,
32
32
function_name ,
33
33
traceback_str ,
34
34
cause_cls ,
35
+ proctitle = None ,
35
36
pid = None ,
36
37
host = None ):
37
38
"""Initialize a RayTaskError."""
38
- if setproctitle :
39
+ if proctitle :
40
+ self .proctitle = proctitle
41
+ elif setproctitle :
39
42
self .proctitle = setproctitle .getproctitle ()
40
43
else :
41
44
self .proctitle = "ray_worker"
@@ -56,24 +59,22 @@ def as_instanceof_cause(self):
56
59
if issubclass (RayTaskError , self .cause_cls ):
57
60
return self # already satisfied
58
61
59
- class cls (self .cause_cls , RayTaskError ):
60
- def __init__ (self , function_name , traceback_str , cause_cls , pid ,
61
- host ):
62
+ class cls (RayTaskError , self .cause_cls ):
63
+ def __init__ (self , function_name , traceback_str , cause_cls ,
64
+ proctitle , pid , host ):
62
65
RayTaskError .__init__ (self , function_name , traceback_str ,
63
- cause_cls , pid , host )
66
+ cause_cls , proctitle , pid , host )
64
67
65
68
name = "RayTaskError({})" .format (self .cause_cls .__name__ )
66
69
cls .__name__ = name
67
70
cls .__qualname__ = name
68
71
69
72
return cls (self .function_name , self .traceback_str , self .cause_cls ,
70
- self .pid , self .host )
71
- cls .original = self
72
- return cls
73
+ self .proctitle , self .pid , self .host )
73
74
74
75
def __str__ (self ):
75
76
"""Format a RayTaskError as a string."""
76
- lines = self .traceback_str .split ("\n " )
77
+ lines = self .traceback_str .strip (). split ("\n " )
77
78
out = []
78
79
in_worker = False
79
80
for line in lines :
0 commit comments