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

Design and implement an effective error message sub-system for our code generation tool #2070

Open
4 of 19 tasks
ArthurMa1978 opened this issue Dec 26, 2024 · 2 comments
Open
4 of 19 tasks
Assignees
Labels
epic feature New feature or request

Comments

@ArthurMa1978
Copy link
Member

ArthurMa1978 commented Dec 26, 2024

We are moving fast, but our tools lack well-designed error messages. Unlike any formal compiler, which provides clear error codes and messages to help developers identify and resolve issues efficiently, we only throw exceptions with lengthy call stack information, which is very user-unfriendly.
Designing an effective error message sub-system is crucial for enhancing user experience and minimizing frustration.
The error message from our tool should be:

  1. Clear and Unambiguous Messages: Ensure that error messages are simple, easy to understand, and contextually relevant. Avoid technical jargon that might confuse users.
  2. Strategic Placement: Position error messages near the relevant field to make it easier for users to identify and correct the issue.
  3. Provide Solutions: Good error messages not only highlight the problem but also offer solutions.
  4. Avoid Blaming the User: Frame error messages in a way that doesn't place blame on the user. For example, instead of saying "You did not specify the format of the property XXX," use "Please specify the form of the property XXX".

Related tasks

Preview Give feedback
  1. v3
  2. Mgmt v3
    pshao25
  3. CodeGen
  4. Mgmt
    live1206
  5. Mgmt question
  6. v3
    live1206
  7. emitter:client:csharp
    JoshLove-msft
  8. emitter:client:python
  9. emitter:client:java
    weidongxu-microsoft
  10. P1 non-azure
    MaryGao qiaozha
  11. jhendrixMSFT
  12. design:needed needs-area
    ArthurMa1978 allenjzhang
    lmazuel m-nash timotheeguerin
@jsquire
Copy link
Member

jsquire commented Jan 13, 2025

@ArthurMa1978: Why is this here and not in the TypeSpec repo? Has this gone through the triage process and been discussed with the generator leads?

@ArthurMa1978 ArthurMa1978 changed the title Design and implement an effective error message sub-system for our .Net code generation tool Design and implement an effective error message sub-system for our code generation tool Jan 14, 2025
@ArthurMa1978
Copy link
Member Author

ArthurMa1978 commented Jan 14, 2025

@ArthurMa1978: Why is this here and not in the TypeSpec repo? Has this gone through the triage process and been discussed with the generator leads?

This initiative encompasses general code generation, including both TypeSpec and Swagger.
Designing a good error message sub-system is a significant undertaking that requires huge effort. This project is not limited to C# but extends to all the languages we support. Therefore, we will draft a design and conduct reviews and discussions across all languages.

@ArthurMa1978 ArthurMa1978 transferred this issue from Azure/azure-sdk-for-net Jan 14, 2025
@ArthurMa1978 ArthurMa1978 added the feature New feature or request label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants