Skip to content

Commit

Permalink
[Service Bus] Remove unused helper methods (#9990)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshaNalluru authored Jul 10, 2020
1 parent ecd6078 commit 91cc3db
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions sdk/servicebus/service-bus/src/util/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,6 @@ export function throwErrorIfConnectionClosed(context: ConnectionContext): void {
}
}

/**
* @internal
* Logs and throws error if the underlying AMQP connection or if the client is closed
* @param context The ConnectionContext associated with the current AMQP connection.
* @param entityPath Entity Path of the client which denotes the name of the Queue/Topic/Subscription
* @param isClientClosed Boolean denoting if the client is closed or not
*/
export function throwErrorIfClientOrConnectionClosed(
context: ConnectionContext,
entityPath: string,
isClientClosed: boolean
): void {
throwErrorIfConnectionClosed(context);
if (context && isClientClosed) {
const errorMessage = getClientClosedErrorMsg(entityPath);
const error = new Error(errorMessage);
log.error(`[${context.connectionId}] %O`, error);
throw error;
}
}

/**
* @internal
* Gets the error message when a client is used when its already closed
* @param entityPath Value of the `entityPath` property on the client which denotes its name
*/
export function getClientClosedErrorMsg(entityPath: string): string {
return (
`The client for "${entityPath}" has been closed and can no longer be used. ` +
`Please create a new client using an instance of ServiceBusClient.`
);
}

/**
* @internal
* Gets the error message when a sender is used when its already closed
Expand Down

0 comments on commit 91cc3db

Please sign in to comment.