Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_errormsg and check #224

Open
GiulioIlBen opened this issue Feb 19, 2025 · 0 comments
Open

get_errormsg and check #224

GiulioIlBen opened this issue Feb 19, 2025 · 0 comments

Comments

@GiulioIlBen
Copy link
Contributor

In the Job class the get_errormsg results depends from check method, but it should be the other way around, if no error is present then the check returns True. For SingleJob.check the default return value is True resulting that by default get_errormsg returns None insted of self._error_msg.

I report the piece of code:

#
class Job
    @abstractmethod
    def check(self) -> bool:
        """Check if the execution of this instance was successful."""

    def get_errormsg(self) -> Optional[str]:
        """Tries to get an error message for a failed job. This method returns ``None`` for successful jobs."""
        if self.check():
            return None

        return (
            self._error_msg
            if self._error_msg
            else "Could not determine error message. Please check the output manually."
        )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant