Skip to content

Commit c649e2b

Browse files
authored
Fix #309 Fallback to no-emoji boot message when failing to load for some reason (#311)
1 parent 76158a8 commit c649e2b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

slack_bolt/util/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,19 @@ def get_boot_message(development_server: bool = False) -> str:
5757
else:
5858
return "Bolt app is running!"
5959

60-
if development_server:
61-
return "⚡️ Bolt app is running! (development server)"
62-
else:
63-
return "⚡️ Bolt app is running!"
60+
try:
61+
if development_server:
62+
return "⚡️ Bolt app is running! (development server)"
63+
else:
64+
return "⚡️ Bolt app is running!"
65+
except ValueError:
66+
# ValueError is a runtime exception for a given value
67+
# It's a super class of UnicodeEncodeError, which may be raised in the scenario
68+
# see also: https://github.com/slackapi/bolt-python/issues/170
69+
if development_server:
70+
return "Bolt app is running! (development server)"
71+
else:
72+
return "Bolt app is running!"
6473

6574

6675
def get_name_for_callable(func: Callable) -> str:

0 commit comments

Comments
 (0)