Skip to content

Commit

Permalink
Connectors: handle slack rate limit as known error (#2425)
Browse files Browse the repository at this point in the history
* Connectors: handle slack rate limit as known error

* move to slack_client
  • Loading branch information
philipperolet authored Nov 7, 2023
1 parent 704f2b2 commit f3b6316
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion connectors/src/connectors/slack/lib/slack_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ export async function getSlackClient(
throw workflowError;
}
}

if (slackError.code === ErrorCode.RateLimitedError) {
// If we get rate limited, we throw a known error. The activity will be
// automatically retried, no need to generate an alert
throw {
__is_dust_error: true,
message: slackError.message,
type: "connector_rate_limit_activity_error",
};
}
throw e;
}
},
Expand Down
3 changes: 2 additions & 1 deletion connectors/src/lib/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export type WorkflowErrorType =
| "unhandled_internal_activity_error"
| "transient_upstream_activity_error"
| "transient_nango_activity_error"
| "upstream_is_down_activity_error";
| "upstream_is_down_activity_error"
| "connector_rate_limit_activity_error";

export type WorkflowError = {
type: WorkflowErrorType;
Expand Down

0 comments on commit f3b6316

Please sign in to comment.