aboutsummaryrefslogtreecommitdiffstats
path: root/slack/error.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2024-02-18 12:43:43 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 12:55:39 +0100
commit24e21c91a03f32b43af9178e15df0574256c9ce7 (patch)
tree02a41eae7786a64c115e5149cc756be8bf79296c /slack/error.py
parentc847e56d0b10499a7dc761f04ddfd0d860fd7788 (diff)
downloadwee-slack-24e21c91a03f32b43af9178e15df0574256c9ce7.tar.gz
Post users.profile.set as a JSON body
It's better to post nested objects as JSON rather than url encoding them, and this fixes some type errors.
Diffstat (limited to 'slack/error.py')
-rw-r--r--slack/error.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/slack/error.py b/slack/error.py
index 917eddf..d190978 100644
--- a/slack/error.py
+++ b/slack/error.py
@@ -2,7 +2,7 @@ from __future__ import annotations
from dataclasses import dataclass, field
from datetime import datetime
-from typing import TYPE_CHECKING, Dict, Mapping, Optional, Sequence, Union
+from typing import TYPE_CHECKING, Dict, Optional
from uuid import uuid4
from slack.python_compatibility import format_exception_only
@@ -40,16 +40,14 @@ class SlackApiError(Exception):
workspace: SlackWorkspace,
method: str,
response: SlackErrorResponse,
- params: Mapping[
- str, Union[str, int, bool, Sequence[str], Sequence[int], Sequence[bool]]
- ] = {},
+ request: object = None,
):
super().__init__(
- f"{self.__class__.__name__}: workspace={workspace}, method='{method}', params={params}, response={response}"
+ f"{self.__class__.__name__}: workspace={workspace}, method='{method}', request={request}, response={response}"
)
self.workspace = workspace
self.method = method
- self.params = params
+ self.request = request
self.response = response
@@ -112,7 +110,7 @@ def store_and_format_uncaught_error(uncaught_error: UncaughtError) -> str:
)
elif isinstance(e, SlackApiError):
return (
- f"Error from Slack API method {e.method} with params {e.params} for workspace "
+ f"Error from Slack API method {e.method} with request {e.request} for workspace "
f"{e.workspace.name}: {e.response} ({stack_msg})"
)
elif isinstance(e, SlackRtmError):