mirror of https://github.com/buster-so/buster.git
fix: throw error when Slack events API returns success: false
Ensure the Slack events endpoint never returns an HTTP 200 with success: false in the response body. Any failed event processing will now properly throw an error and return an appropriate error status code. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
35193e53ce
commit
4fe488e1bd
|
@ -147,6 +147,12 @@ export async function handleSlackEventsEndpoint(c: Context) {
|
||||||
try {
|
try {
|
||||||
// Process the event
|
// Process the event
|
||||||
const response = await eventsHandler(payload);
|
const response = await eventsHandler(payload);
|
||||||
|
|
||||||
|
// Ensure we never return success: false without throwing
|
||||||
|
if (!response.success) {
|
||||||
|
throw new Error('Event processing failed');
|
||||||
|
}
|
||||||
|
|
||||||
return c.json(response);
|
return c.json(response);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Handle authentication errors
|
// Handle authentication errors
|
||||||
|
|
Loading…
Reference in New Issue