Repository navigation
Conversation
|
This only solves half of the issue, as hooks are sill not considered. For a good and clean solution we need a more involved refactor, maybe turning the hook+error+cast behavior into a decorator so we can wrap the route callback with it (multiple times if needed). There is also the question of hooks should all fire, or only the inner-most hooks (as with plugins), for which I do not have a definite answer right now. As a workaround you can always fall back to mounting app.wsgi which is the most isolated mounting method. Maybe this is not an implementation issue, but more a documentation issue? |
- Update Bottle.mount() docstring to note that hooks and custom error handlers are not run on natively mounted sub-applications. - Add detailed explanation and example using app.wsgi workaround to docs/plugins/index.rst. ai-assisted-by: Antigravity, Gemini 3.5 Flash License: I explicitly license this contribution as public domain.
|
Hi! Thanks for the feedback. I completely agree that a proper runtime fix would require a much more involved refactoring of how hooks, errors, and cast operations interact. As suggested, I have reverted the code changes and instead updated the documentation to address this:
I've force-pushed the new commits and updated the PR description. Let me know if this looks good to you! |
Description
Following the maintainer's feedback on the complexity and open design questions around modifying hook and error handler resolution for natively mounted applications, this PR document these limitations and details the recommended workaround (
app.wsgi).Changes
Bottle.mount()to note that hooks and custom error handlers of natively mounted sub-applications are bypassed.docs/plugins/index.rst("Hooks, Error Handlers and Application Mounting") explaining the behavior and providing an example of mounting via the sub-application's WSGI interface (app.wsgi) for full isolation.AI Disclosure and Manual Review
This contribution was prepared with the assistance of the AI agent Antigravity (using Gemini 3.5 Flash).
The documentation changes were manually proofread and verified for formatting correctness.
License
I explicitly license all my contributions to this project as public domain.