Skip to content

docs: Document custom serializable exceptions#573

Open
loopassembly wants to merge 1 commit into
serverpod:mainfrom
loopassembly:docs/custom-serializable-exceptions
Open

docs: Document custom serializable exceptions#573
loopassembly wants to merge 1 commit into
serverpod:mainfrom
loopassembly:docs/custom-serializable-exceptions

Conversation

@loopassembly
Copy link
Copy Markdown

Summary

  • Add guidance for custom Dart exception classes that should be serialized to the client.
  • Document that custom exception classes must implement SerializableException.
  • Clarify that external/shared exception classes still need an extraClasses entry so generated serialization can reconstruct them on the client.

Verification

  • npx --yes --cache ./.npm-cache markdownlint-cli docs/06-concepts/04-exceptions.md
  • git diff --check

I did not run a docs build because serverpod_docs/AGENTS.md says not to run build commands locally.

Closes serverpod/serverpod#3421

Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds documentation explaining how to create and register custom exceptions that can be safely serialized and sent from Serverpod server to client.

Changes:

  • Documented SerializableException implementation for shared Dart exceptions
  • Documented registering shared exceptions via extraClasses in config/generator.yaml

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

Comment on lines +67 to +69
class UserFacingException implements SerializableException {
final String message;
final String? code;
Comment on lines +101 to +102
extraClasses:
- package:my_project_shared/my_project_shared.dart:UserFacingException
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.

Missing documentation for Custom Serializable Exceptions.

2 participants