From 6dceb2d692081da8704f4da2fd6f4f53db063d24 Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 22 May 2022 16:33:53 -0500 Subject: [PATCH] Import apiclient.exceptions to use apiclient.exceptions.ServerError --- pyteamsnap/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyteamsnap/api.py b/pyteamsnap/api.py index 0e01922..d516427 100644 --- a/pyteamsnap/api.py +++ b/pyteamsnap/api.py @@ -1,4 +1,6 @@ __all__ = ['TeamSnap', 'Team', 'Event', 'Availability', 'Member', 'Location', 'Me'] + +import apiclient.exceptions from apiclient import APIClient, HeaderAuthentication, JsonResponseHandler, JsonRequestFormatter import datetime @@ -16,7 +18,7 @@ class ApiObject(): def search(cls, client, **kwargs): try: results = client.query(cls.rel, "search", **kwargs) - except ServerError as e: + except apiclient.exceptions.ServerError as e: pass return [cls(client,rel=cls.rel, data=r) for r in results]