Skip to content

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

@ArthurMa1978

Description

@ArthurMa1978

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".
### Features
- [ ] https://github.com/microsoft/typespec/issues/3347
- [ ] https://github.com/microsoft/typespec/issues/5575
- [ ] https://github.com/microsoft/typespec/issues/5576
- [ ] https://github.com/microsoft/typespec/issues/5578
- [ ] https://github.com/Azure/autorest.go/issues/1485
- [ ] https://github.com/Azure/autorest.typescript/issues/2991
- [ ] https://github.com/Azure/autorest.csharp/issues/5176
### Related tasks
- [ ] https://github.com/Azure/autorest.csharp/issues/2913
- [ ] https://github.com/Azure/autorest.csharp/issues/5190
- [ ] https://github.com/Azure/autorest.csharp/issues/5192
- [ ] https://github.com/Azure/azure-sdk-for-net/issues/37826
- [ ] https://github.com/Azure/autorest.csharp/issues/4691
- [ ] https://github.com/Azure/autorest.csharp/issues/5176
- [ ] https://github.com/microsoft/typespec/issues/5508
- [ ] https://github.com/microsoft/typespec/issues/5509
- [ ] https://github.com/microsoft/typespec/issues/5511
- [ ] https://github.com/Azure/autorest.typescript/issues/2979
- [ ] https://github.com/Azure/autorest.go/issues/1484
- [ ] https://github.com/microsoft/typespec/issues/5660

Metadata

Metadata

Assignees

Labels

epicfeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions