From a392523a380d1bc2ecd9a5d60992f7bab76fd982 Mon Sep 17 00:00:00 2001 From: FoamyGuy Date: Sun, 31 May 2020 10:29:56 -0500 Subject: [PATCH] catch the group full exception and re-raise with more descriptive message --- adafruit_display_text/label.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adafruit_display_text/label.py b/adafruit_display_text/label.py index 7a59f0d..4ec19ef 100755 --- a/adafruit_display_text/label.py +++ b/adafruit_display_text/label.py @@ -238,9 +238,12 @@ def text(self): @text.setter def text(self, new_text): - current_anchored_position = self.anchored_position - self._update_text(str(new_text)) - self.anchored_position = current_anchored_position + try: + current_anchored_position = self.anchored_position + self._update_text(str(new_text)) + self.anchored_position = current_anchored_position + except RuntimeError: + raise RuntimeError("Text length exceeds max_glyphs") @property def font(self):