-
Notifications
You must be signed in to change notification settings - Fork 42
Labels
Description
Related to:
microsoft/Agents#294
microsoft/Agents#273
microsoft/Agents#339
Refactor the error / exception text that's currently throughout the codebase into a single resource file. The C# pattern for this is here:
https://github.com/microsoft/Agents-for-net/edit/main/src/libraries/Client/Microsoft.Agents.Connector/Errors/ErrorHelper.cs#L36C66
This error text should include 3 things:
- The formatting string used for the error. (extracted from the current code)
- An Error code (can align with C#) that get added to the error text.
- A URL that also gets added to the error text. The URL should follow the pattern:
https://aka.ms/M365AgentsErrorCodes/#agentic-identity-with-the-m365-agents-sdk
This should result in an exception that looks like:
- Original code:
raise ValueError(f"Failed to acquire token. {str(auth_result_payload)}") - Revised Code:
raise ValueError(f"{error_resources.FailedToAcquireToken})
The actual logged string would look like:
Failed to acquire token.
... [payload goes here, just as it does today] ...
Error Code: -60012
Help URL: https://aka.ms/M365AgentsErrorCodes/#agentic-identity-with-the-m365-agents-sdk
Once the code is refactored, I'll update the URLs for the Agentic Errors to have the correct deep-link hashtags.
This refactor seems a good candidate for being done via a one of the LLMs.
Copilot