I am working on a library database module (See this thread). I want to implement a custom error class.
class LibraryError(Exception): def __init__(self, value): self.parameter = value def __str__(self): return repr(self.parameter)
This class needs to handle errors such as sql execute errors, and be able to check for empty searches. Also it should allow for the exceptions to be handled differently depending on the front end implementation. I understand the basics of how to create an error sub-class, and how to raise the error using the 'raise' keyword. Though I am a bit confused on how to implement and raise the features in my program.