forked from Olav63/outils_OSM
27 lines
482 B
Python
27 lines
482 B
Python
#!/usr/bin/env python3
|
|
"""Errors module"""
|
|
|
|
|
|
class ApiError(Exception):
|
|
"""Api exception"""
|
|
|
|
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}"
|
|
|
|
|
|
class OverpassError(ApiError):
|
|
"""Overpass exception"""
|
|
|
|
pass
|
|
|
|
|
|
class GeoApiError(ApiError):
|
|
"""GeoApi exception"""
|
|
|
|
pass
|