Skip to content

Commit 4e9e686

Browse files
committed
Update readme and comments
1 parent fa07ab1 commit 4e9e686

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

api/docs/vscode-azureresources-api.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ export declare interface AzureResourcesApiRequestContext {
225225
/**
226226
* Optional callback invoked when an error occurs during the Azure Resources API handshake process.
227227
*
228-
* @remarks Errors thrown during execution of this callback may be part of a separate process and will not naturally bubble up to users.
229-
* If you wish to surface specific errors to users, please consider using the VS Code API to display these manually.
228+
* @remarks Errors thrown during execution of this callback may be part of a separate process and may not bubble up to users.
229+
* If you wish to surface specific errors to users, please consider logging them or using the VS Code API to display them through UI.
230230
*
231231
* @param error - The error that occurred during the handshake, containing an error code and message.
232232
*/

api/src/auth/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ const context: AzureResourcesApiRequestContext = {
6363
ext.rgApiV2.resources.registerAzureResourceBranchDataProvider(AzExtResourceType.ContainerAppsEnvironment, ext.branchDataProvider);
6464
},
6565

66-
// Optional: Can use for error handling / telemetry
66+
// OPTIONAL: Can use for special error handling & telemetry
67+
// NOTE: Errors thrown during execution of this callback may be part of a separate process and may not bubble up to users.
68+
// If you wish to surface specific errors to users, please consider logging them or using the VS Code API to display them through UI.
6769
onApiRequestError: async (error: AzureResourcesApiRequestError) => {
6870
switch (true) {
69-
case error.code === AzureResourcesHandshakeErrors.CLIENT_FAILED_CREATE_CREDENTIAL.code:
70-
case error.code === AzureResourcesHandshakeErrors.HOST_CREATE_SESSION_FAILED.code:
71-
case error.code === AzureResourcesHandshakeErrors.CLIENT_RECEIVED_INSUFFICIENT_CREDENTIALS.code:
72-
case error.code === AzureResourcesHandshakeErrors.CLIENT_CREDENTIAL_FAILED_VERIFICATION.code:
73-
case error.code === AzureResourcesHandshakeErrors.HOST_API_PROVISIONING_FAILED.code:
71+
case error.code === AzureResourcesApiRequestErrorCode.CLIENT_FAILED_CREATE_CREDENTIAL:
72+
case error.code === AzureResourcesApiRequestErrorCode.HOST_CREATE_SESSION_FAILED:
73+
case error.code === AzureResourcesApiRequestErrorCode.CLIENT_RECEIVED_INSUFFICIENT_CREDENTIALS:
74+
case error.code === AzureResourcesApiRequestErrorCode.CLIENT_CREDENTIAL_FAILED_VERIFICATION:
75+
case error.code === AzureResourcesApiRequestErrorCode.HOST_API_PROVISIONING_FAILED:
7476
default:
7577
}
7678
},

api/src/auth/apiRequest/AzureResourcesApiRequestContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export interface AzureResourcesApiRequestContext {
2323
/**
2424
* Optional callback invoked when an error occurs during the Azure Resources API handshake process.
2525
*
26-
* @remarks Errors thrown during execution of this callback may be part of a separate process and will not naturally bubble up to users.
27-
* If you wish to surface specific errors to users, please consider using the VS Code API to display these manually.
26+
* @remarks Errors thrown during execution of this callback may be part of a separate process and may not bubble up to users.
27+
* If you wish to surface specific errors to users, please consider logging them or using the VS Code API to display them through UI.
2828
*
2929
* @param error - The error that occurred during the handshake, containing an error code and message.
3030
*/

0 commit comments

Comments
 (0)