12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- class NoLineError(Exception):
- """Custom exception to indicate that a test file doesn't contain
- the requested string.
- """
- def __init__(self, file_name, string):
- """Constructor.
- Args:
- file_name (string): The name of the test file.
- string (string): The string that was requested.
- """
- super(NoLineError, self).__init__()
- self.file_name = file_name
- self.string = string
- def __str__(self):
- """Shows a readable representation of the exception."""
- return ('File {0} has no line containing the following string: {1}'
- .format(self.file_name, self.string))
- class DebugError(Exception):
- """Custom exception to indicate that a required debugging symbol is missing.
- """
- def __init__(self, symbol):
- """Constructor.
- Args:
- symbol (string): The name of the entity whose debug info is missing.
- """
- super(DebugError, self).__init__()
- self.symbol = symbol
- def __str__(self):
- """Shows a readable representation of the exception."""
- return ('The required debugging information for {0} is missing.'
- .format(self.symbol))
|