Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Error-Handling #47

Open
pixelmund opened this issue Feb 20, 2022 · 0 comments
Open

Better Error-Handling #47

pixelmund opened this issue Feb 20, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pixelmund
Copy link
Owner

Describe the bug

Currently there is no easy way to throw errors inside loaders/actions. We should probably come up with an easy to use solution.

I have something like the following in my head:

<script context="module" ssr>
  import {  NotFoundError, HttpError } from "svemix/errors"
  export const loader = () => {
    throw new NotFoundError("User not found").
    throw new HttpError("Custom Error", { status: 401 });
   }
</script>

Which we could then make use of via instanceOf

Your Example Website or App

--

Steps to Reproduce the Bug or Issue

--

Expected behavior

--

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

Would make life easier

@pixelmund pixelmund added enhancement New feature or request good first issue Good for newcomers labels Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant