pylint-errors

W9006 (missing-raises-doc)

:x: Problematic code:

class Foo:
    def bar(self, n):
        """A dummy description.

        :param int n: a dummy variable.
        :returns: - a result.
        :rtype: int
        """

        try:
            return 1 / n
        except ZeroDivisionError as e:
            raise e

:heavy_check_mark: Correct code:

class Foo:
    def bar(self, n):
        """A dummy description.

        :param int n: a dummy variable.
        :raises ZeroDivisionError: when a value is zero.
        :returns: - a result.
        :rtype: int
        """

        try:
            return 1 / n
        except ZeroDivisionError as e:
            raise e

Rationale:

Please document exceptions for all raised exception types.