From c247d6e6fddb91a43b99758711912e8a6ed3e97c Mon Sep 17 00:00:00 2001 From: Alex Schofield Date: Tue, 5 May 2026 21:51:09 +0100 Subject: add exceptions.py for custom exceptions --- fnme/exceptions.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 fnme/exceptions.py (limited to 'fnme/exceptions.py') diff --git a/fnme/exceptions.py b/fnme/exceptions.py new file mode 100644 index 0000000..29e317e --- /dev/null +++ b/fnme/exceptions.py @@ -0,0 +1,34 @@ +class LocationError(Exception): + """Exception raised for errors related to fetching location. + + Attributes: + message -- explanation of the error + """ + + def __init__(self, message): + self.message = message + super().__init__(self.message) + + +class DataFetchError(Exception): + """Exception raised for errors related to fetching latest data. + + Attributes: + message -- explanation of the error + """ + + def __init__(self, message): + self.message = message + super().__init__(self.message) + + +class InvalidDataError(Exception): + """Exception raised for errors related to the contents of the data. + + Attributes: + message -- explanation of the error + """ + + def __init__(self, message): + self.message = message + super().__init__(self.message) -- cgit v1.2.3