Skip to content

Conversation

@exacs
Copy link
Contributor

@exacs exacs commented Nov 27, 2025

This PR:

  • Adds the property name in all thrown errors to show the class name instead of Error
  • Adds an error page in hello-world sample site. (Note: package must be bumped in sample site, will be done in a separate PR)
  • Removes console.log from runtime

Copilot finished reviewing on behalf of exacs November 27, 2025 10:07
Copy link
Contributor

Copilot AI left a comment

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 debugging in the Optimizely CMS SDK by adding explicit error names, demonstrating error handling patterns, and cleaning up runtime logging.

  • Sets explicit name property on all custom error classes to display the class name instead of generic "Error"
  • Adds an error page component to the hello-world sample demonstrating error handling with instanceof checks
  • Removes development-time console.log from runtime component rendering

Reviewed changes

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

File Description
packages/optimizely-cms-sdk/src/graph/error.ts Adds name property to all 5 custom error classes for better error identification
packages/optimizely-cms-sdk/src/react/server.tsx Removes console.log for missing components; fallback UI already provides visual feedback in dev mode
samples/hello-world/src/app/error.tsx New Next.js error boundary demonstrating specific error type handling using instanceof checks

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

@exacs exacs merged commit aa01f74 into main Nov 28, 2025
10 checks passed
@exacs exacs deleted the feature/CMS-47081-errors branch November 28, 2025 08:08
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.

3 participants