Skip to content

Conversation

@UmakanthKaspa
Copy link
Contributor

@UmakanthKaspa UmakanthKaspa commented Jan 14, 2026

Problem
Used wrong variable data.message - data doesn't exist here, so errors showed nothing.

Fix
Changed to error?.messages?.[0] - same pattern as BookingForm.vue

Summary by CodeRabbit

  • Bug Fixes
    • Fixed error message handling in cancellation request submissions to ensure accurate error messages are displayed when requests fail.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Modified error message retrieval in cancellation request submission handler. Changed from reading data.message to error?.messages?.[0], ensuring error notifications display from the actual error object rather than potentially undefined fallback values.

Changes

Cohort / File(s) Summary
Error handling fix
dashboard/src/components/CancellationRequestDialog.vue
Updated error handler to read message from error?.messages?.[0] instead of data.message, improving error notification reliability

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A message lost in data's maze,
Now found where error's truth displays,
The optional chain leads us right,
To messages clear, sharp, and bright!
One change, one line, all fixed with grace! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing the error message display in the cancellation dialog by using the correct variable reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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



📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5cdc15d and 512a396.

📒 Files selected for processing (1)
  • dashboard/src/components/CancellationRequestDialog.vue
🧰 Additional context used
📓 Path-based instructions (2)
**/*.vue

📄 CodeRabbit inference engine (.github/instructions/frappe-ui.instructions.md)

**/*.vue: Use createResource() from frappe-ui to make backend API calls with configuration for url, params, and methods like fetch() and submit() in Vue components
Use createDocumentResource() to manage individual document records with support for whitelisted methods, events (onError, onSuccess, transform), and methods like reload(), setValue(), delete(), and custom whitelisted method calls
Use useList() hook to create a list resource for fetching records of a DocType from Frappe backend with options for fields, filters, orderBy, pageLength, caching, and events (onError, onSuccess, transform)
Use ListView component with props columns, rows, row-key, and options to render tabular data with support for selection, tooltips, resizable columns, and custom rendering slots
Define ListView columns with required label and key properties, optional width (as multiplier or px/rem), align (start/left, center/middle, end/right), and custom attributes for rendering
Define ListView rows with unique identifier matching the row-key prop, and field values as strings or objects with label property for custom rendering
For grouped ListView rows, structure data as array of objects with group string, collapsed boolean, and rows array containing row objects
Use Badge component with props variant ('solid', 'subtle', 'outline', 'ghost'), theme ('gray', 'blue', 'green', 'orange', 'red'), and size ('sm', 'md', 'lg') for displaying status indicators
Use FormControl component with type prop ('text', 'number', 'email', 'date', 'password', 'search', 'textarea', 'select', 'autocomplete', 'checkbox'), size ('sm', 'md', 'lg', 'xl'), variant ('subtle', 'outline'), and optional prefix and suffix slots
Use toast from frappe-ui for notifications with methods toast.success(), toast.warning(), and toast.error() to provide user feedback
Use Dropdown component with options prop containing action items with label, icon (lucide i...

Files:

  • dashboard/src/components/CancellationRequestDialog.vue
{main.js,**/*.vue}

📄 CodeRabbit inference engine (.github/instructions/frappe-ui.instructions.md)

For Options API components using resources, register the resourcesPlugin in main.js and declare resources under the resources key as functions, accessible via this.$resources.[name]

Files:

  • dashboard/src/components/CancellationRequestDialog.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Server
🔇 Additional comments (1)
dashboard/src/components/CancellationRequestDialog.vue (1)

297-302: LGTM! Correctly fixes the error message retrieval.

The fix properly accesses the error object's messages array within the onError callback. The previous data.message reference was invalid since data is only available in the onSuccess handler. The optional chaining and fallback message ensure robust error handling.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

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.

1 participant