exceptions.py 826 B

12345678910111213141516171819202122232425
  1. # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  2. # For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
  3. # Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
  4. from __future__ import annotations
  5. class UnrecognizedArgumentAction(Exception):
  6. """Raised if an ArgumentManager instance tries to add an argument for which the
  7. action is not recognized.
  8. """
  9. class _UnrecognizedOptionError(Exception):
  10. """Raised if an ArgumentManager instance tries to parse an option that is
  11. unknown.
  12. """
  13. def __init__(self, options: list[str], *args: object) -> None:
  14. self.options = options
  15. super().__init__(*args)
  16. class ArgumentPreprocessingError(Exception):
  17. """Raised if an error occurs during argument pre-processing."""