From 90201923becb9dd0f3ab86f531f4c8c33dff07bd Mon Sep 17 00:00:00 2001 From: SebF Date: Sun, 3 Oct 2021 15:40:29 +0200 Subject: [PATCH] =?UTF-8?q?extraction=20des=20erreurs=20dans=20une=20class?= =?UTF-8?q?e=20s=C3=A9par=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osm_vc63/errors.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 osm_vc63/errors.py diff --git a/osm_vc63/errors.py b/osm_vc63/errors.py new file mode 100644 index 0000000..11dd585 --- /dev/null +++ b/osm_vc63/errors.py @@ -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