microsoft / microsoft/typespec

[http-client-js] Emitters should not crash on purpose

Open
#6,575 1 comment 0 reactions 1 assignee Assigned to @joheredi View on GitHub
emitter:client:js
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

Similar to autorest [emitter](https://github.com/Azure/autorest.typescript/issues/3064), efv2 should also not crash on purpose.

See from https://github.com/microsoft/typespec/issues/5660#issuecomment-2629604149
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.