Skip to content
Snippets Groups Projects
Commit 86e5d2df authored by DAVID Axel's avatar DAVID Axel
Browse files

docs: :pencil: Document init method of error.

parent bfc931fb
No related branches found
No related tags found
No related merge requests found
Pipeline #15245 passed
...@@ -75,6 +75,7 @@ class InvalidElementValueError(ValueError): ...@@ -75,6 +75,7 @@ class InvalidElementValueError(ValueError):
"""Thrown if an element in the version is less than 0.""" """Thrown if an element in the version is less than 0."""
def __init__(self, element: int, element_type: Element) -> None: def __init__(self, element: int, element_type: Element) -> None:
"""Create an InvalidElementValueError from the element and element_type."""
super().__init__( super().__init__(
f"The {element_type} is equal to '{element}'." f"The {element_type} is equal to '{element}'."
+ " Please give an integer greater or equal to zero.", + " Please give an integer greater or equal to zero.",
...@@ -86,6 +87,7 @@ class InvalidMajorValueError(InvalidElementValueError): ...@@ -86,6 +87,7 @@ class InvalidMajorValueError(InvalidElementValueError):
"""Thrown if 'major' is less than 0.""" """Thrown if 'major' is less than 0."""
def __init__(self, major: int) -> None: def __init__(self, major: int) -> None:
"""Create an InvalidMajorValueError from the major."""
super().__init__(major, Element.MAJOR) super().__init__(major, Element.MAJOR)
...@@ -94,6 +96,7 @@ class InvalidMinorValueError(InvalidElementValueError): ...@@ -94,6 +96,7 @@ class InvalidMinorValueError(InvalidElementValueError):
"""Thrown if 'minor' is less than 0.""" """Thrown if 'minor' is less than 0."""
def __init__(self, minor: int) -> None: def __init__(self, minor: int) -> None:
"""Create an InvalidMinorValueError from the minor."""
super().__init__(minor, Element.MINOR) super().__init__(minor, Element.MINOR)
...@@ -102,4 +105,5 @@ class InvalidPatchValueError(InvalidElementValueError): ...@@ -102,4 +105,5 @@ class InvalidPatchValueError(InvalidElementValueError):
"""Thrown if 'patch' is less than 0.""" """Thrown if 'patch' is less than 0."""
def __init__(self, patch: int) -> None: def __init__(self, patch: int) -> None:
"""Create an InvalidPatchValueError from the patch."""
super().__init__(patch, Element.PATCH) super().__init__(patch, Element.PATCH)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment