MCPcopy
hub / github.com/ray-project/ray / _make_normal_dual_exception_instance

Method _make_normal_dual_exception_instance

python/ray/exceptions.py:175–207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

173 return self._make_normal_dual_exception_instance()
174
175 def _make_normal_dual_exception_instance(self) -> "RayTaskError":
176 cause_cls = self.cause.__class__
177 error_msg = str(self)
178
179 class cls(RayTaskError, cause_cls):
180 def __init__(self, cause):
181 self.cause = cause
182 # Store args separately to avoid writing to user-defined
183 # read-only or property-based `args`.
184 self._ray_task_error_args = (cause,)
185
186 @property
187 def args(self):
188 return self._ray_task_error_args
189
190 @args.setter
191 def args(self, value):
192 self._ray_task_error_args = value
193
194 def __reduce__(self):
195 return (cls, self._ray_task_error_args)
196
197 def __getattr__(self, name):
198 return getattr(self.cause, name)
199
200 def __str__(self):
201 return error_msg
202
203 name = f"RayTaskError({cause_cls.__name__})"
204 cls.__name__ = name
205 cls.__qualname__ = name
206
207 return cls(self.cause)
208
209 def _make_exceptiongroup_dual_exception_instance(self) -> "RayTaskError":
210 cause_cls = self.cause.__class__

Callers 1

Calls 1

clsClass · 0.85

Tested by

no test coverage detected