Skip to content

Commit 17a3aed

Browse files
authored
[service-bus] Rename ServiceBusErrorCode Unauthorized to UnauthorizedAccess (Azure#12571)
This change makes us more consistent with the AMQP condition and the .NET exception.
1 parent 993c7bc commit 17a3aed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sdk/servicebus/service-bus/review/service-bus.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export type ServiceBusErrorCode =
359359
/**
360360
* The user doesn't have access to the entity.
361361
*/
362-
| "Unauthorized";
362+
| "UnauthorizedAccess";
363363

364364
// @public
365365
export interface ServiceBusMessage {

sdk/servicebus/service-bus/src/serviceBusError.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export type ServiceBusErrorCode =
6161
/**
6262
* The user doesn't have access to the entity.
6363
*/
64-
| "Unauthorized";
64+
| "UnauthorizedAccess";
6565

6666
/**
6767
* Translation between the MessagingErrorCodes into a ServiceBusCode
@@ -85,7 +85,7 @@ export const wellKnownMessageCodesToServiceBusCodes: Map<string, ServiceBusError
8585
["ServiceCommunicationError", "ServiceCommunicationProblem"],
8686
["SessionCannotBeLockedError", "SessionCannotBeLocked"],
8787
["SessionLockLostError", "SessionLockLost"],
88-
["UnauthorizedError", "Unauthorized"]
88+
["UnauthorizedError", "UnauthorizedAccess"]
8989
]);
9090

9191
/**
@@ -108,7 +108,7 @@ export class ServiceBusError extends MessagingError {
108108
* - **ServiceCommunicationProblem**: There was a general communications error encountered when interacting with the Azure Service Bus service.
109109
* - **SessionCannotBeLocked**: The requested session cannot be locked.
110110
* - **SessionLockLost**: The lock on the session has expired. Callers should request the session again.
111-
* - **Unauthorized"**: The user doesn't have access to the entity.
111+
* - **UnauthorizedAccess"**: The user doesn't have access to the entity.
112112
*/
113113
// NOTE: make sure this list and the list above are properly kept in sync.
114114
code: ServiceBusErrorCode;

0 commit comments

Comments
 (0)