-
Notifications
You must be signed in to change notification settings - Fork 0
Skunkworks 2024! #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skunkworks 2024! #96
Conversation
vstehlik
commented
Oct 23, 2024
- Updates to dependencies
…darToSlack into SK24-UpdateDependencies
…darToSlack into SK24-UpdateDependencies
…darToSlack into SK24-UpdateDependencies
src/services/slack.ts
Outdated
@@ -46,7 +44,8 @@ export const setUserPresence = async (email: string, token: string | undefined, | |||
const slackClient = new WebClient(token); | |||
|
|||
try { | |||
await slackClient.users.setPresence({ presence }); | |||
const result = await slackClient.users.setPresence({ presence }); | |||
throw result.error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to throw the error or just log it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think throwing is still good 🤔 The handleError function ends up checking the error message and if it's "token_revoked" or "invalid_auth" it clears the tokens and sends the user a message in Slack to re-auth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be wrapped in a conditional statement then to only throw if there is an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swapped to the the response ok
boolean and only throw if that's missing/false!
2079346
Co-authored-by: Val Stehlik <[email protected]>
Co-authored-by: Val Stehlik <[email protected]>
SK24 - Update dependencies and migrate from yarn v1 to npm