aboutsummaryrefslogtreecommitdiffstats
path: root/slack/error.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-08-23 23:10:20 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit2df26d96ec689b965b925709c5ca223c2094d9e7 (patch)
treef150b22f09e78e70deb050c96c8fdcf3d00eccca /slack/error.py
parentfed3a064a788b94f1c0b420bf276c158f8197ddf (diff)
downloadwee-slack-2df26d96ec689b965b925709c5ca223c2094d9e7.tar.gz
Use blocks to render messages
Diffstat (limited to 'slack/error.py')
-rw-r--r--slack/error.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/slack/error.py b/slack/error.py
index c978584..1a13504 100644
--- a/slack/error.py
+++ b/slack/error.py
@@ -92,8 +92,8 @@ def format_exception_only_str(exc: BaseException) -> str:
return format_exception_only(exc)[-1].strip()
-def store_and_format_exception(e: BaseException):
- uncaught_error = UncaughtError(e)
+def store_and_format_uncaught_error(uncaught_error: UncaughtError) -> str:
+ e = uncaught_error.exception
shared.uncaught_errors.append(uncaught_error)
stack_msg_command = f"/slack debug error {uncaught_error.id}"
stack_msg = f"run `{stack_msg_command}` for the stack trace"
@@ -120,3 +120,8 @@ def store_and_format_exception(e: BaseException):
)
else:
return f"Unknown error occurred: {format_exception_only_str(e)} ({stack_msg})"
+
+
+def store_and_format_exception(e: BaseException) -> str:
+ uncaught_error = UncaughtError(e)
+ return store_and_format_uncaught_error(uncaught_error)