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

use_router can be called multiple times, but only the last router is used #323

Open
baronfel opened this issue Nov 13, 2021 · 1 comment · May be fixed by #384
Open

use_router can be called multiple times, but only the last router is used #323

baronfel opened this issue Nov 13, 2021 · 1 comment · May be fixed by #384

Comments

@baronfel
Copy link
Contributor

I was talking to Mathias today and we discovered that he had multiple calls to use_router in his application, so only the second one was being processed. We should look at ways to mitigate this problem, because we don't warn the user in any way about this behavior.

@isaacabraham
Copy link
Collaborator

My advice is to throw an exception if this happens (assuming we can detect it). It's easy to do and will fail fast.

ChrSteinert added a commit to ChrSteinert/Saturn that referenced this issue May 31, 2024
ChrSteinert added a commit to ChrSteinert/Saturn that referenced this issue May 31, 2024
Adds a check when `use_router` is called twice, or `use_router` after
`no_router` or the other way around, and fail directly.
This is to prohibit setting two routers, which does not have any effect…
only the last router is used, which might be confusing.

Fixes SaturnFramework#323.
@ChrSteinert ChrSteinert linked a pull request May 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants