added exception handling to a division by zero error
This commit is contained in:
parent
be8364b69c
commit
2b127c225d
1 changed files with 6 additions and 1 deletions
|
|
@ -43,7 +43,12 @@ class InkyScreen(commands.Cog):
|
||||||
width = self.display.WIDTH
|
width = self.display.WIDTH
|
||||||
height = self.display.HEIGHT
|
height = self.display.HEIGHT
|
||||||
lines = len(text)
|
lines = len(text)
|
||||||
height_diff = height/lines
|
try:
|
||||||
|
height_diff = height/lines
|
||||||
|
except:
|
||||||
|
self.bot.logger.exception("InkyScreen: Failed to calculate height_diff.")
|
||||||
|
self.bot.logger.info(f"InkyScreen: Text: {text}")
|
||||||
|
return
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 0
|
||||||
for line in text:
|
for line in text:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue