Skip to content

Commit 4ac1998

Browse files
Copilotcleemullins
andauthored
Replace help_url_anchor with error_code in error message URLs (#237)
* Initial plan * Update error links to use error code instead of help_url_anchor Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cleemullins <1165321+cleemullins@users.noreply.github.com>
1 parent daabfef commit 4ac1998

9 files changed

Lines changed: 10 additions & 93 deletions

File tree

libraries/microsoft-agents-activity/microsoft_agents/activity/errors/error_resources.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,31 @@ class ActivityErrorResources:
2020
InvalidChannelIdType = ErrorMessage(
2121
"Invalid type for channel_id: {0}. Expected ChannelId or str.",
2222
-64000,
23-
"activity-schema",
2423
)
2524

2625
ChannelIdProductInfoConflict = ErrorMessage(
2726
"Conflict between channel_id.sub_channel and productInfo entity",
2827
-64001,
29-
"activity-schema",
3028
)
3129

3230
ChannelIdValueConflict = ErrorMessage(
3331
"If value is provided, channel and sub_channel must be None",
3432
-64002,
35-
"activity-schema",
3633
)
3734

3835
ChannelIdValueMustBeNonEmpty = ErrorMessage(
3936
"value must be a non empty string if provided",
4037
-64003,
41-
"activity-schema",
4238
)
4339

4440
InvalidFromPropertyType = ErrorMessage(
4541
"Invalid type for from_property: {0}. Expected ChannelAccount or dict.",
4642
-64004,
47-
"activity-schema",
4843
)
4944

5045
InvalidRecipientType = ErrorMessage(
5146
"Invalid type for recipient: {0}. Expected ChannelAccount or dict.",
5247
-64005,
53-
"activity-schema",
5448
)
5549

5650
def __init__(self):

libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/errors/error_resources.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,55 +20,46 @@ class AuthenticationErrorResources:
2020
FailedToAcquireToken = ErrorMessage(
2121
"Failed to acquire token. {0}",
2222
-60012,
23-
"agentic-identity-with-the-m365-agents-sdk",
2423
)
2524

2625
InvalidInstanceUrl = ErrorMessage(
2726
"Invalid instance URL",
2827
-60013,
29-
"agentic-identity-with-the-m365-agents-sdk",
3028
)
3129

3230
OnBehalfOfFlowNotSupportedManagedIdentity = ErrorMessage(
3331
"On-behalf-of flow is not supported with Managed Identity authentication.",
3432
-60014,
35-
"agentic-identity-with-the-m365-agents-sdk",
3633
)
3734

3835
OnBehalfOfFlowNotSupportedAuthType = ErrorMessage(
3936
"On-behalf-of flow is not supported with the current authentication type: {0}",
4037
-60015,
41-
"agentic-identity-with-the-m365-agents-sdk",
4238
)
4339

4440
AuthenticationTypeNotSupported = ErrorMessage(
4541
"Authentication type not supported",
4642
-60016,
47-
"agentic-identity-with-the-m365-agents-sdk",
4843
)
4944

5045
AgentApplicationInstanceIdRequired = ErrorMessage(
5146
"Agent application instance Id must be provided.",
5247
-60017,
53-
"agentic-identity-with-the-m365-agents-sdk",
5448
)
5549

5650
FailedToAcquireAgenticInstanceToken = ErrorMessage(
5751
"Failed to acquire agentic instance token or agent token for agent_app_instance_id {0}",
5852
-60018,
59-
"agentic-identity-with-the-m365-agents-sdk",
6053
)
6154

6255
AgentApplicationInstanceIdAndUserIdRequired = ErrorMessage(
6356
"Agent application instance Id and agentic user Id must be provided.",
6457
-60019,
65-
"agentic-identity-with-the-m365-agents-sdk",
6658
)
6759

6860
FailedToAcquireInstanceOrAgentToken = ErrorMessage(
6961
"Failed to acquire instance token or agent token for agent_app_instance_id {0} and agentic_user_id {1}",
7062
-60020,
71-
"agentic-identity-with-the-m365-agents-sdk",
7263
)
7364

7465
def __init__(self):

libraries/microsoft-agents-copilotstudio-client/microsoft_agents/copilotstudio/client/errors/error_resources.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,36 @@ class CopilotStudioErrorResources:
2020
CloudBaseAddressRequired = ErrorMessage(
2121
"cloud_base_address must be provided when PowerPlatformCloud is Other",
2222
-65000,
23-
"copilot-studio-client",
2423
)
2524

2625
EnvironmentIdRequired = ErrorMessage(
2726
"EnvironmentId must be provided",
2827
-65001,
29-
"copilot-studio-client",
3028
)
3129

3230
AgentIdentifierRequired = ErrorMessage(
3331
"AgentIdentifier must be provided",
3432
-65002,
35-
"copilot-studio-client",
3633
)
3734

3835
CustomCloudOrBaseAddressRequired = ErrorMessage(
3936
"Either CustomPowerPlatformCloud or cloud_base_address must be provided when PowerPlatformCloud is Other",
4037
-65003,
41-
"copilot-studio-client",
4238
)
4339

4440
InvalidConnectionSettingsType = ErrorMessage(
4541
"connection_settings must be of type DirectToEngineConnectionSettings",
4642
-65004,
47-
"copilot-studio-client",
4843
)
4944

5045
PowerPlatformEnvironmentRequired = ErrorMessage(
5146
"PowerPlatformEnvironment must be provided",
5247
-65005,
53-
"copilot-studio-client",
5448
)
5549

5650
AccessTokenProviderRequired = ErrorMessage(
5751
"AccessTokenProvider must be provided",
5852
-65006,
59-
"copilot-studio-client",
6053
)
6154

6255
def __init__(self):

libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/errors/error_message.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ class ErrorMessage:
1313
This class formats error messages according to the Microsoft Agents SDK pattern:
1414
- Original error message
1515
- Error Code: [negative number]
16-
- Help URL: https://aka.ms/M365AgentsErrorCodes/#anchor
16+
- Help URL: https://aka.ms/M365AgentsErrorCodes/#[error_code]
1717
"""
1818

1919
def __init__(
2020
self,
2121
message_template: str,
2222
error_code: int,
23-
help_url_anchor: str = "agentic-identity-with-the-m365-agents-sdk",
2423
):
2524
"""
2625
Initialize an ErrorMessage.
@@ -29,12 +28,9 @@ def __init__(
2928
:type message_template: str
3029
:param error_code: The error code (should be negative)
3130
:type error_code: int
32-
:param help_url_anchor: The anchor for the help URL (defaults to agentic identity)
33-
:type help_url_anchor: str
3431
"""
3532
self.message_template = message_template
3633
self.error_code = error_code
37-
self.help_url_anchor = help_url_anchor
3834
self.base_url = "https://aka.ms/M365AgentsErrorCodes"
3935

4036
def format(self, *args, **kwargs) -> str:
@@ -56,7 +52,7 @@ def format(self, *args, **kwargs) -> str:
5652
return (
5753
f"{message}\n\n"
5854
f"Error Code: {self.error_code}\n"
59-
f"Help URL: {self.base_url}/#{self.help_url_anchor}"
55+
f"Help URL: {self.base_url}/#{self.error_code}"
6056
)
6157

6258
def __str__(self) -> str:

libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/errors/error_resources.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,176 +25,147 @@ class ErrorResources:
2525
AdapterRequired = ErrorMessage(
2626
"start_agent_process: adapter can't be None",
2727
-63000,
28-
"hosting-configuration",
2928
)
3029

3130
AgentApplicationRequired = ErrorMessage(
3231
"start_agent_process: agent_application can't be None",
3332
-63001,
34-
"hosting-configuration",
3533
)
3634

3735
RequestRequired = ErrorMessage(
3836
"CloudAdapter.process: request can't be None",
3937
-63002,
40-
"hosting-configuration",
4138
)
4239

4340
AgentRequired = ErrorMessage(
4441
"CloudAdapter.process: agent can't be None",
4542
-63003,
46-
"hosting-configuration",
4743
)
4844

4945
StreamAlreadyEnded = ErrorMessage(
5046
"The stream has already ended.",
5147
-63004,
52-
"streaming",
5348
)
5449

5550
TurnContextRequired = ErrorMessage(
5651
"TurnContext cannot be None.",
5752
-63005,
58-
"hosting-configuration",
5953
)
6054

6155
ActivityRequired = ErrorMessage(
6256
"Activity cannot be None.",
6357
-63006,
64-
"hosting-configuration",
6558
)
6659

6760
AppIdRequired = ErrorMessage(
6861
"AppId cannot be empty or None.",
6962
-63007,
70-
"hosting-configuration",
7163
)
7264

7365
InvalidActivityType = ErrorMessage(
7466
"Invalid or missing activity type.",
7567
-63008,
76-
"hosting-configuration",
7768
)
7869

7970
ConversationIdRequired = ErrorMessage(
8071
"Conversation ID cannot be empty or None.",
8172
-63009,
82-
"hosting-configuration",
8373
)
8474

8575
AuthHeaderRequired = ErrorMessage(
8676
"Authorization header is required.",
8777
-63010,
88-
"hosting-configuration",
8978
)
9079

9180
InvalidAuthHeader = ErrorMessage(
9281
"Invalid authorization header format.",
9382
-63011,
94-
"hosting-configuration",
9583
)
9684

9785
ClaimsIdentityRequired = ErrorMessage(
9886
"ClaimsIdentity is required.",
9987
-63012,
100-
"hosting-configuration",
10188
)
10289

10390
ChannelServiceRouteNotFound = ErrorMessage(
10491
"Channel service route not found for: {0}",
10592
-63013,
106-
"hosting-configuration",
10793
)
10894

10995
TokenExchangeRequired = ErrorMessage(
11096
"Token exchange requires a token exchange resource.",
11197
-63014,
112-
"hosting-configuration",
11398
)
11499

115100
MissingHttpClient = ErrorMessage(
116101
"HTTP client is required.",
117102
-63015,
118-
"hosting-configuration",
119103
)
120104

121105
InvalidBotFrameworkActivity = ErrorMessage(
122106
"Invalid Bot Framework Activity format.",
123107
-63016,
124-
"hosting-configuration",
125108
)
126109

127110
CredentialsRequired = ErrorMessage(
128111
"Credentials are required for authentication.",
129112
-63017,
130-
"hosting-configuration",
131113
)
132114

133115
# General/Validation Errors (-66000 to -66999)
134116
InvalidConfiguration = ErrorMessage(
135117
"Invalid configuration: {0}",
136118
-66000,
137-
"configuration",
138119
)
139120

140121
RequiredParameterMissing = ErrorMessage(
141122
"Required parameter missing: {0}",
142123
-66001,
143-
"configuration",
144124
)
145125

146126
InvalidParameterValue = ErrorMessage(
147127
"Invalid parameter value for {0}: {1}",
148128
-66002,
149-
"configuration",
150129
)
151130

152131
OperationNotSupported = ErrorMessage(
153132
"Operation not supported: {0}",
154133
-66003,
155-
"configuration",
156134
)
157135

158136
ResourceNotFound = ErrorMessage(
159137
"Resource not found: {0}",
160138
-66004,
161-
"configuration",
162139
)
163140

164141
UnexpectedError = ErrorMessage(
165142
"An unexpected error occurred: {0}",
166143
-66005,
167-
"configuration",
168144
)
169145

170146
InvalidStateObject = ErrorMessage(
171147
"Invalid state object: {0}",
172148
-66006,
173-
"configuration",
174149
)
175150

176151
SerializationError = ErrorMessage(
177152
"Serialization error: {0}",
178153
-66007,
179-
"configuration",
180154
)
181155

182156
DeserializationError = ErrorMessage(
183157
"Deserialization error: {0}",
184158
-66008,
185-
"configuration",
186159
)
187160

188161
TimeoutError = ErrorMessage(
189162
"Operation timed out: {0}",
190163
-66009,
191-
"configuration",
192164
)
193165

194166
NetworkError = ErrorMessage(
195167
"Network error occurred: {0}",
196168
-66010,
197-
"configuration",
198169
)
199170

200171
def __init__(self):

0 commit comments

Comments
 (0)