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

[python] Emitters should not crash on purpose #6081

Open
msyyc opened this issue Feb 20, 2025 · 0 comments · May be fixed by #6104
Open

[python] Emitters should not crash on purpose #6081

msyyc opened this issue Feb 20, 2025 · 0 comments · May be fixed by #6104
Assignees
Labels
emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Comments

@msyyc
Copy link
Contributor

msyyc commented Feb 20, 2025

See from #5660 (comment)
Emitters should report errors as many as possible therefore if possible, emitters should not crash on purpose (for example throw new Error).
Throwing an error will cause the emitter to crash, and when the emitter crashes, typespec compiler will flag this as a bug in the emitter and recommend the user to open an issue for it.
For those unexpected, it is fine that the emitter would crash, because it is "unexpected", we could never prevent it therefore it should be categorized as a bug.
Please go through the code to ensure we do not throw Error unless we really want the emitter to crash, otherwise we should report error diagnostic.

@msyyc msyyc added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Feb 20, 2025
@msyyc msyyc self-assigned this Feb 20, 2025
@msyyc msyyc linked a pull request Feb 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:python Issue for the Python client emitter: @typespec/http-client-python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant