PostHog / squeak

A Q&A widget for your docs
https://squeak.posthog.com/
MIT License
178 stars 15 forks source link

Handle invite errors #170

Open corywatilo opened 2 years ago

corywatilo commented 2 years ago

I tried to invite a user and it appeared successful, but they didn't get an invite. So I checked server logs and found:

[web] [2022-05-16 16:10:09] [🧵 Invite] Error inviting user
[web] [2022-05-16 16:10:09] [🧵 Invite] A user with this email address has already been registered
[web] [2022-05-16 16:10:20] Error: An API error occurred: account_inactive
[web] [2022-05-16 16:10:20]     at platformErrorFromResult (/app/node_modules/@slack/web-api/dist/errors.js:51:33)
[web] [2022-05-16 16:10:20]     at WebClient.apiCall (/app/node_modules/@slack/web-api/dist/WebClient.js:167:56)
[web] [2022-05-16 16:10:20]     at runMicrotasks (<anonymous>)
[web] [2022-05-16 16:10:20]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[web] [2022-05-16 16:10:20]     at async channels (/app/.next/server/pages/api/slack/channels.js:33:24)
[web] [2022-05-16 16:10:20]     at async Object.apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:182:9)
[web] [2022-05-16 16:10:20]     at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:386:9)
[web] [2022-05-16 16:10:20]     at async Object.fn (/app/node_modules/next/dist/server/base-server.js:488:37)
[web] [2022-05-16 16:10:20]     at async Router.execute (/app/node_modules/next/dist/server/router.js:228:32)
[web] [2022-05-16 16:10:20]     at async NextNodeServer.run (/app/node_modules/next/dist/server/base-server.js:600:29) {
[web] [2022-05-16 16:10:20]   code: 'slack_webapi_platform_error',
[web] [2022-05-16 16:10:20]   data: { ok: false, error: 'account_inactive', response_metadata: {} }
[web] [2022-05-16 16:10:20] }