From fb04f1b7369a9ee62551569788faa45e780f101f Mon Sep 17 00:00:00 2001 From: Nick Newman Date: Mon, 14 Feb 2022 10:56:58 -0500 Subject: [PATCH] Change general Exceptions in Configuration --- newspaper/configuration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newspaper/configuration.py b/newspaper/configuration.py index 94688e705..9cfea2894 100644 --- a/newspaper/configuration.py +++ b/newspaper/configuration.py @@ -82,14 +82,14 @@ def get_language(self): return self._language def del_language(self): - raise Exception('wtf are you doing?') + raise AttributeError("A language must be associated with the configuration.") def set_language(self, language): """Language setting must be set in this method b/c non-occidental (western) languages require a separate stopwords class. """ if not language or len(language) != 2: - raise Exception("Your input language must be a 2 char language code, \ + raise ValueError("Your input language must be a 2 char language code, \ for example: english-->en \n and german-->de") # If explicitly set language, don't use meta