diff options
| author | Alex Schofield <git@ajschof.me> | 2026-05-05 21:51:09 +0100 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2026-05-05 21:51:09 +0100 |
| commit | c247d6e6fddb91a43b99758711912e8a6ed3e97c (patch) | |
| tree | e97981fef18861954d86e492fcbbfad98ab045ef | |
| parent | 8fa5fca8602a54e70313b916c6ce0337de6b2151 (diff) | |
| download | fuelnearme-c247d6e6fddb91a43b99758711912e8a6ed3e97c.tar.gz fuelnearme-c247d6e6fddb91a43b99758711912e8a6ed3e97c.zip | |
add exceptions.py for custom exceptions
| -rw-r--r-- | fnme/exceptions.py | 34 |
1 files changed, 34 insertions, 0 deletions
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) |
