#!/usr/bin/env python
# -*- coding: utf-8 -*-
[docs]class CommandlinesError(Exception):
"""Base exception class for all exceptions raised by the commandlines library"""
def __init__(self, message):
Exception.__init__(self, message)
[docs]class MissingArgumentError(CommandlinesError):
"""Missing argument exception"""
def __init__(self, argument):
self.error_message = "Missing argument exception: the argument '" + argument + "' was not found."
CommandlinesError.__init__(self, self.error_message)
[docs]class MissingDictionaryKeyError(CommandlinesError):
"""Missing dictionary key exception"""
def __init__(self, dict_key):
self.error_message = "Missing dictionary key exception: the dictionary key '" + dict_key + "' was not found."
CommandlinesError.__init__(self, self.error_message)
[docs]class IndexOutOfRangeError(CommandlinesError, IndexError):
"""Index out of range exception"""
def __init__(self):
self.error_message = "Index out of range exception. The requested index fell outside of the index range."
IndexError.__init__(self)
CommandlinesError.__init__(self, self.error_message)