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

Throwing exceptions in UIX hybrid routing #194

Open
jonasstrehle opened this issue Oct 8, 2024 · 0 comments
Open

Throwing exceptions in UIX hybrid routing #194

jonasstrehle opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working essential

Comments

@jonasstrehle
Copy link
Member

🕗 Version & Regression Information

  • This is a bug

💻 Code

// backend/entrypoint.ts
import { HTTPError } from "uix/html/http-error.ts";
export default {
	'/error': () => {
		throw new Error();
	},
	'/status': () => new HTTPError(404)
};
// frontend/entrypoint.ts
export default {
	'*': "Nope"
}

🙁 Actual behavior

When visiting backend routes that throw (whether it is HTTPError or Runtime error), the frontend *-wildcard matcher is loaded.

🙂 Expected behavior

We'd expect to see the thrown error and abort the route resolval when an error is thrown as it would be in common program flows.

Additional information about the issue

As discussed in Weekly 08/10/24

@jonasstrehle jonasstrehle added bug Something isn't working essential labels Oct 8, 2024
@jonasstrehle jonasstrehle changed the title UIX hybrid routing UIX hybrid routing throws Oct 8, 2024
@jonasstrehle jonasstrehle changed the title UIX hybrid routing throws Throwing issues in UIX hybrid routing Oct 8, 2024
@jonasstrehle jonasstrehle changed the title Throwing issues in UIX hybrid routing Throwing exceptions in UIX hybrid routing Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working essential
Projects
None yet
Development

No branches or pull requests

2 participants