Skip to content

refactor(dashboard): simplify error handling in build-dashboard#5170

Open
SHUBHANSHU602 wants to merge 1 commit intoasyncapi:masterfrom
SHUBHANSHU602:simplify-error-handling
Open

refactor(dashboard): simplify error handling in build-dashboard#5170
SHUBHANSHU602 wants to merge 1 commit intoasyncapi:masterfrom
SHUBHANSHU602:simplify-error-handling

Conversation

@SHUBHANSHU602
Copy link

@SHUBHANSHU602 SHUBHANSHU602 commented Feb 17, 2026

Replaces redundant return Promise.reject(error) with throw error
inside async functions in build-dashboard.ts.

This makes error handling more idiomatic and aligned with modern async/await usage.

Resolves #3305

Summary by CodeRabbit

  • Refactor
    • Internal error handling improvements to enhance code maintainability and consistency.

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2676a24
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/6993b830eafc350007de5ae5
😎 Deploy Preview https://deploy-preview-5170--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

This refactors error handling in build-dashboard.ts to use throw statements instead of Promise.reject(), making async error patterns more idiomatic. Catch blocks now consistently use error naming and propagate caught errors via throw after logging.

Changes

Cohort / File(s) Summary
Error Handling Refactor
scripts/dashboard/build-dashboard.ts
Replaced Promise.reject(e) with throw statements in async functions (getDiscussions, getDiscussionByID, processHotDiscussions, start). Renamed catch block variables from e to error for consistency. Error logging preserved in all catch handlers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 No more rejection's bitter sting,
We throw our errors like the spring!
From e to error, clear and bright,
Our async code now feels just right. ✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: refactoring error handling in the build-dashboard script to be simpler and more idiomatic.
Linked Issues check ✅ Passed The pull request successfully addresses issue #3305 by replacing Promise.reject with throw statements in async functions, making error handling more idiomatic.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #3305 requirement; the refactoring focuses solely on simplifying error handling without introducing unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c02a12f) to head (2676a24).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #5170   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          796       796           
  Branches       146       146           
=========================================
  Hits           796       796           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@asyncapi-bot
Copy link
Contributor

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 37
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-5170--asyncapi-website.netlify.app/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Be Triaged

Development

Successfully merging this pull request may close these issues.

Simplify error handling in build-dashboard.js

2 participants