Slack Bolt Global Error Handling Strategy Prompt
Design a layered error-handling strategy for a Slack Bolt app — global error listener, per-listener try/catch, user-facing failure UX, retries, and structured logging.
- Target user
- Backend engineers hardening a production Bolt app
- Difficulty
- Advanced
- Tools
- Claude, Copilot
The prompt
You are a senior backend engineer who has run Slack Bolt apps in production and knows where they silently fail. I will provide: - The Bolt runtime (Node or Python) and Socket Mode vs HTTP - The listener surface (commands, actions, view submissions, events) - Downstream dependencies (DBs, internal APIs, external services) - Current symptoms (swallowed errors, the 3-second ack timeout, dead buttons) - Logging and alerting stack Your job: 1. **Error taxonomy** — separate user errors, Slack API errors (rate limits, `expired_trigger_id`, `not_in_channel`), downstream failures, and programming bugs; each needs different handling. 2. **The 3-second ack** — show the ack-then-process pattern so long work never blocks the response; explain why missing the ack produces broken modals and retried events. 3. **Global listener** — implement Bolt's global error handler as the safety net; log structured context (listener, user, team, payload type) without leaking secrets. 4. **User-facing UX** — on failure, post an ephemeral message or update the modal with a clear, non-leaky error and a retry path, not a stack trace. 5. **Retries + idempotency** — handle Slack's Events API retries with an idempotency key; add bounded backoff for transient Slack/downstream errors; never retry non-idempotent side effects blindly. 6. **Observability** — emit metrics for error rate by listener, ack latency, and rate-limit hits; alert on spikes. Output as: (a) layered handler pseudocode (per-listener + global), (b) an error taxonomy table mapping cause to user message and retry policy, (c) the structured log schema, (d) the metrics and alerts to add. Fail loud in logs and metrics but quiet and clear to users; never surface a stack trace or token into a Slack message.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack App Distributed Tracing Instrumentation Prompt
Instrument a Slack Bolt app with OpenTelemetry traces, metrics, and logs to debug latency across events, actions, and API calls
-
Slack Bot Health Check & Heartbeat Self-Monitoring Prompt
Design self-monitoring and heartbeat checks for a Slack bot so that the bot's own outages (token expiry, socket drops, queue backlog) are detected and surfaced externally.
-
Slack App Cold-Start & 3-Second Ack Latency Optimization Prompt
Diagnose and fix Slack app latency that breaks the 3-second ack budget — serverless cold starts, sync work in handlers, and defer-then-followup patterns.
-
Prometheus Alert Rule to Slack Template Prompt
Author Prometheus alerting rules whose labels and annotations render directly into a high-signal Slack message — required summary/runbook/dashboard fields, severity labels, and a Go template that produces a scannable Block Kit-ready payload.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.