extraction des erreurs dans une classe séparée
This commit is contained in:
parent
1c568b6895
commit
90201923be
19
osm_vc63/errors.py
Normal file
19
osm_vc63/errors.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
class Api_error(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 Overpass_error(Api_error):
|
||||
pass
|
||||
|
||||
|
||||
class Geo_api_error(Api_error):
|
||||
pass
|
Loading…
Reference in New Issue
Block a user