A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
792 B

  1. # -*- coding: utf-8 -*-
  2. """
  3. EarwigBot's Wiki Toolset: Exceptions
  4. This module contains all exceptions used by the wiki.tools package.
  5. """
  6. class WikiToolsetError(Exception):
  7. """Base exception class for errors in the Wiki Toolset."""
  8. class ConfigError(WikiToolsetError):
  9. """An error occured when trying to do something involving our config
  10. file. Maybe it hasn't been loaded?"""
  11. class SiteNotFoundError(WikiToolsetError):
  12. """A site matching the args given to get_site() could not be found in the
  13. config file."""
  14. class UserNotFoundError(WikiToolsetError):
  15. """Attempting to get information about a user that does not exist."""
  16. def __init__(self, name):
  17. self.name = name
  18. def __str__(self):
  19. return "User '{0}' does not exist.".format(self.name)