Document error handling best practices
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
There are currently a variety of tools available for error handling in SvelteKit:
+error.sveltepages- The
errorhelper <svelte:boundary>and itsfailedsnippet- Vanilla Javascript
try/catchlogic handleValidationErrorhooks
These all have their place, but the documentation lacks an overview of when to use which tool.
I was surprised, for example, that <button onclick={() => {throw Error("say what?")}>Yo</button> wasn't caught by a <svelte:boundary>.
Describe the proposed solution
A best practices page for error handling, providing an guided tour of each of these tools. The page would not go into depth on each tool, but rather focus on explain when and how to use each tool your project.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing documentation for +error.svelte pages, the error helper, svelte:boundary, vanilla JavaScript try/catch, and handleValidationError. Add an error-handling best-practices page that explains when and how each tool is used, including the documented boundary behavior for errors thrown in button onclick handlers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100