From eff0efdf40c47c85d088993361781b14048984cf Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 29 Jan 2020 23:52:25 -0800 Subject: [PATCH] Indicate required feature in exception message. --- etiquette/decorators.py | 2 +- etiquette/exceptions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etiquette/decorators.py b/etiquette/decorators.py index 9ee6964..f457af7 100644 --- a/etiquette/decorators.py +++ b/etiquette/decorators.py @@ -40,7 +40,7 @@ def required_feature(features): pass elif cfg is False: - raise exceptions.FeatureDisabled(method.__qualname__) + raise exceptions.FeatureDisabled(feature) else: raise ValueError(f'Bad required_feature: "{feature}" led to {cfg}') diff --git a/etiquette/exceptions.py b/etiquette/exceptions.py index 38e08c7..517298b 100644 --- a/etiquette/exceptions.py +++ b/etiquette/exceptions.py @@ -178,7 +178,7 @@ class FeatureDisabled(EtiquetteException): ''' For when features of the system have been disabled by the configuration. ''' - error_message = 'This feature has been disabled.' + error_message = 'This feature has been disabled. Requires {}.' class NotExclusive(EtiquetteException): '''