From 3b4eddfec307a46280f9066862d5e3369a489f2d Mon Sep 17 00:00:00 2001 From: Samuel Roach Date: Wed, 6 Jul 2022 22:26:21 +0100 Subject: [PATCH] Changed exception for incorrect single request --- ergast_py/ergast.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ergast_py/ergast.py b/ergast_py/ergast.py index 373d491..3f4436a 100644 --- a/ergast_py/ergast.py +++ b/ergast_py/ergast.py @@ -257,7 +257,8 @@ class Ergast(): items = self._get_items(get_items, construct_items) if len(items) == 1: return items[0] - raise Warning("More than 1 element found") + raise Exception(f'Data loss will occur with this query. 1 item' \ + f' requested but {len(items)} found.') # Race and Results Queries