-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Actually, it's not all user defined exceptions which do this. It's any exception class for which the constructor has multiple required parameters.
I fixed it in my case by defining default values for all but the first parameter in the constructor for the exception. Like this:
class MyCalledProcessError(Exception):
def __init__(self, stderr: str | bytes, returncode: int = 0, cmd: List[str] = []):
"""To avoid showing as Unknown in redun console, the constructor must have only one parameter without default value."""
self.stderr = stderr
self.returncode = returncode
self.cmd = cmd
super().__init__(str(self))
My guess is that deserializing the exception from the redun database for use in the console is failing because it tries to create the exception object with only a single parameter before populating the rest. But that is a guess, I didn't have a close look at how that works.
If it is fixable that would be great. Otherwise this issue can help others who stumble over the same behaviour.
Metadata
Metadata
Assignees
Labels
No labels