10000 [Feature Request] Continue to run even if introduce syntax errors · Issue #135 · GoogleCloudPlatform/functions-framework-python · GitHub
[go: up one dir, main page]

Skip to content

[Feature Request] Continue to run even if introduce syntax errors #135

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

Closed
ALiangLiang opened this issue Jul 3, 2021 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@ALiangLiang
Copy link
ALiangLiang commented Jul 3, 2021

If I used native flask run to launch a functions as a server, it will keep running even though I raise a syntax error. But functions-framework can't. Is there a way to implement this mechanism in this nice tool? It's annoying to always re-command manually.

I survey how flask works with it and found an article about this mechanism.

@ALiangLiang ALiangLiang changed the title Continue to run even if introduce syntax errors [Feature Request] Continue to run even if introduce syntax errors Jul 3, 2021
@di di added the enhancement New feature or request label Jul 7, 2021
@di
Copy link
Member
di commented Jul 7, 2021

This is a bit tricky, because the execution of the user-supplied source happens before the Flask development server is started, during the creation of the WSGI app:

spec.loader.exec_module(source_module)

This means that we haven't started Flask's reloader yet and don't have access to another reloader. We'd need to manually catch any exceptions and raise them to the user in a reloader loop, but ideally one that's able to watch the filesystem for changes so as not to constantly be executing the module.

I agree that this can be annoying though, so I'll leave this open for now and see if we can find a better solution.

@ALiangLiang
Copy link
Author
ALiangLiang commented Jul 7, 2021

I see. Indeed, it's a complex problem. Maybe someone can provide a shell script workaround to auto re-launch functions-framwork on doc or example?

@josephlewis42
Copy link
Contributor

This looks like a duplicate of #213

@josephlewis42 josephlewis42 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
0