You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
tesujimath
pushed a commit
to AgResearch/gbs_prism
that referenced
this issue
Jan 31, 2025
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:
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.
The text was updated successfully, but these errors were encountered: