|
22 | 22 | AuthenticationMethod.OAUTH_TOKEN, |
23 | 23 | AuthenticationMethod.AUTH_PROVIDER, |
24 | 24 | ], |
25 | | - oauth_type=OAuthType.WITH_REFRESH, |
26 | | - auth_config_class=None, |
| 25 | + oauth_type=OAuthType.ACCESS_ONLY, |
| 26 | + auth_config_class="SlackAuthConfig", |
27 | 27 | config_class="SlackConfig", |
28 | 28 | labels=["Communication", "Messaging"], |
29 | 29 | supports_continuous=False, |
@@ -200,7 +200,20 @@ async def _fetch_search_page( |
200 | 200 | if not response_data.get("ok"): |
201 | 201 | error = response_data.get("error", "unknown_error") |
202 | 202 | self.logger.error(f"Slack search API error: {error}") |
203 | | - return None |
| 203 | + |
| 204 | + # Provide helpful error messages for common issues |
| 205 | + if error == "missing_scope": |
| 206 | + raise ValueError( |
| 207 | + "Slack search failed: missing 'search:read' scope. " |
| 208 | + "Please ensure your Slack OAuth connection includes the 'search:read' scope " |
| 209 | + "to enable message search." |
| 210 | + ) |
| 211 | + elif error == "not_authed": |
| 212 | + raise ValueError("Slack search failed: authentication token is invalid or expired") |
| 213 | + elif error == "account_inactive": |
| 214 | + raise ValueError("Slack search failed: account is inactive") |
| 215 | + else: |
| 216 | + raise ValueError(f"Slack search failed: {error}") |
204 | 217 |
|
205 | 218 | return response_data |
206 | 219 |
|
|
0 commit comments