sveltejs / sveltejs/kit

Document error handling best practices

Open Beginner friendly
#14,530 1 comment 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation error handling
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.