-
Notifications
You must be signed in to change notification settings - Fork 243
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
[python] Don't throw error directly when emitter crash #6104
base: main
Are you sure you want to change the base?
Conversation
You can try these changes here
|
All changed packages have been documented.
Show changes
|
severity: "error", | ||
messages: { | ||
default: | ||
"Python is not installed. Please follow https://www.python.org/ to install Python or set 'use-pyodide' to true.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be an error, because we should automatically call use-pyodide
if that is the case. The only way an error like this would occur is if someone explicitly set use-pyodide=false
without having python. In that case, I think the error name would be better being something like pyodide-flag-conflict
or something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense and I think pyodide-flag-conflict
is reasonable here.
Updated.
"unknown-error": { | ||
severity: "error", | ||
messages: { | ||
default: paramMessage`Can't generate Python client code from this TypeSpec, please open an issue on https://github.com/microsoft/typespec'.\n${"stack"}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default: paramMessage`Can't generate Python client code from this TypeSpec, please open an issue on https://github.com/microsoft/typespec'.\n${"stack"}`, | |
default: paramMessage`Can't generate Python client code from this TypeSpec. Please open an issue on https://github.com/microsoft/typespec'.${"stack"}`, |
fix #6081
We shall not throw error when emitter crash. Instead, we should catch the errors then report them with

reportDiagnostic
provided by compiler: