docs: Document custom serializable exceptions#573
Conversation
There was a problem hiding this comment.
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
SerializableExceptionimplementation for shared Dart exceptions - Documented registering shared exceptions via
extraClassesinconfig/generator.yaml
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the review notes. I checked these against the source and nearby docs examples. I kept the example aligned with that source contract and repo style, then reran the checks. The latest title, markdown-lint, and Docusaurus test-build checks are all green now. |
Swiftaxe
left a comment
There was a problem hiding this comment.
Very neat PR. Just added a small suggestion.
Thank you for this contribution @loopassembly!
|
|
||
| ### Custom serializable exception classes | ||
|
|
||
| Use the `exception` keyword in a Serverpod model file when you define a new |
There was a problem hiding this comment.
Nit: The very first sentence, "Use the 'exception'..." is a repitition of above under ## Serializable exceptions. Also it seems to contain a line break after 'new'. Suggestion to cut the sentence.
Summary
SerializableException.extraClassesentry so generated serialization can reconstruct them on the client.Verification
npx --yes --cache ./.npm-cache markdownlint-cli docs/06-concepts/04-exceptions.mdgit diff --checkI did not run a docs build because
serverpod_docs/AGENTS.mdsays not to run build commands locally.Closes serverpod/serverpod#3421