2021-10-03 15:40:29 +02:00
|
|
|
#!/usr/bin/env python3
|
2021-10-10 16:31:54 +02:00
|
|
|
"""Errors module"""
|
2021-10-03 15:40:29 +02:00
|
|
|
|
|
|
|
|
2021-10-10 16:31:54 +02:00
|
|
|
class ApiError(Exception):
|
|
|
|
"""Api exception"""
|
|
|
|
|
2021-10-03 15:40:29 +02:00
|
|
|
def __init__(self, http_code, message="erreur appel API"):
|
|
|
|
self.http_code = http_code
|
|
|
|
self.message = message
|
|
|
|
super().__init__(self.message)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return f"{self.http_code} -> {self.message}"
|
|
|
|
|
|
|
|
|
2021-10-10 16:31:54 +02:00
|
|
|
class OverpassError(ApiError):
|
|
|
|
"""Overpass exception"""
|
|
|
|
|
2021-10-03 15:40:29 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2021-10-10 16:31:54 +02:00
|
|
|
class GeoApiError(ApiError):
|
|
|
|
"""GeoApi exception"""
|
|
|
|
|
2021-10-03 15:40:29 +02:00
|
|
|
pass
|