Skip to content

get_errormsg and check #224

Description

@GiulioIlBen

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."
        )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions