Skip to content

fix: improve error handling and response messages in webhook and user…#62

Merged
Vamsi-o merged 1 commit into
mainfrom
feature/configs
Jan 27, 2026
Merged

fix: improve error handling and response messages in webhook and user…#62
Vamsi-o merged 1 commit into
mainfrom
feature/configs

Conversation

@Vamsi-o

@Vamsi-o Vamsi-o commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

… routes

  • Updated the webhook error response to use return for consistency in handling.
  • Changed the status code for invalid Zod schema errors from FORBIDDEN to BAD_REQUEST for better clarity.
  • Modified error toast message in WorkflowCanvas to accurately reflect the failure context during workflow execution.

Summary by CodeRabbit

Bug Fixes

  • Improved error handling for webhook operations to ensure proper responses
  • Corrected HTTP status code returned for workflow validation failures
  • Enhanced error messaging for workflow execution to provide clearer feedback

✏️ Tip: You can customize this high-level summary in your review settings.

… routes

- Updated the webhook error response to use return for consistency in handling.
- Changed the status code for invalid Zod schema errors from FORBIDDEN to BAD_REQUEST for better clarity.
- Modified error toast message in WorkflowCanvas to accurately reflect the failure context during workflow execution.
Copilot AI review requested due to automatic review settings January 27, 2026 13:57
@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR implements three targeted error handling improvements across the hooks, backend, and web layers: making the webhook catch block return a terminal HTTP 500 response, correcting the /executeWorkflow validation error status from 403 to 400, and updating the workflow execution error message from "Failed to save config" to "Failed to Execute Workflow".

Changes

Cohort / File(s) Summary
Webhook Error Response
apps/hooks/src/index.ts
Changed catch block to return HTTP 500 response instead of just sending it, ensuring error handling is terminal and prevents subsequent code execution.
Route Validation Status
apps/http-backend/src/routes/userRoutes/userRoutes.ts
Corrected Zod validation error response status code from FORBIDDEN (403) to BAD_REQUEST (400) in /executeWorkflow endpoint.
Workflow UI Error Message
apps/web/app/workflows/[id]/page.tsx
Updated error toast message in WorkflowCanvas execute path from "Failed to save config" to "Failed to Execute Workflow" for better clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Feature/hooks #47: Directly modifies the same webhook catch block to return a 500 error response with matching terminal error handling logic.
  • Feature/workflowmodel #59: Contains broader refactor of apps/web/app/workflows/[id]/page.tsx where this PR adjusts the error messaging.
  • Fix/config #56: Modifies workflow execution and UI feedback behavior in the same workflow file.

Poem

🐰 Three little fixes, hopping through the code,
Error responses now follow the proper road,
Status codes aligned, messages crystal clear,
Bug-free workflows make the users cheer! 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title partially addresses the changes but is vague and truncated. It mentions 'webhook and user' but doesn't capture the actual scope of fixing error handling across three distinct areas with specific improvements like status code corrections and message clarifications. Consider a more specific title like 'fix: improve error handling with correct status codes and messages' or 'fix: standardize error handling across webhook, routes, and UI components'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves error handling and user-facing messages across the workflow execution system. The changes correct a misleading error message, improve HTTP status code semantics for validation errors, and ensure consistent response handling in the webhook endpoint.

Changes:

  • Fixed error toast message in WorkflowCanvas to accurately reflect workflow execution failure instead of config save failure
  • Changed HTTP status code from FORBIDDEN (403) to BAD_REQUEST (400) for Zod schema validation errors, better reflecting the nature of client input errors
  • Added return statement to webhook error response for consistency and to prevent potential issues with response handling

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/web/app/workflows/[id]/page.tsx Updated error toast message to correctly indicate workflow execution failure
apps/http-backend/src/routes/userRoutes/userRoutes.ts Changed validation error status code from FORBIDDEN to BAD_REQUEST for better semantic accuracy
apps/hooks/src/index.ts Added return statement to error response for consistency with success path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (!parsedData.success) {
return res.status(statusCodes.FORBIDDEN).json({
return res.status(statusCodes.BAD_REQUEST).json({
message: "Error in Zod Schma",

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message contains a spelling error: "Schma" should be "Schema".

Suggested change
message: "Error in Zod Schma",
message: "Error in Zod Schema",

Copilot uses AI. Check for mistakes.
@Vamsi-o
Vamsi-o merged commit 413d63a into main Jan 27, 2026
7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants