Skip to content

Commit 62c1827

Browse files
authored
[service-bus] loosens parameter type in isServiceBusError type guard (Azure#12493)
* [service-bus] loosens paramter type in isServiceBusError type guard * change unknown to any
1 parent c23212d commit 62c1827

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
```ts
66

77
import { AmqpAnnotatedMessage } from '@azure/core-amqp';
8-
import { AmqpError } from 'rhea-promise';
98
import { delay } from '@azure/core-amqp';
109
import { Delivery } from 'rhea-promise';
1110
import { HttpResponse } from '@azure/core-http';
@@ -136,7 +135,7 @@ export interface GetMessageIteratorOptions extends OperationOptionsBase {
136135
}
137136

138137
// @public
139-
export function isServiceBusError(err: Error | AmqpError | ServiceBusError): err is ServiceBusError;
138+
export function isServiceBusError(err: any): err is ServiceBusError;
140139

141140
// @public
142141
export interface MessageHandlers {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ export function translateServiceBusError(err: AmqpError | Error): ServiceBusErro
172172
*
173173
* @param err An error to check to see if it's of type ServiceBusError
174174
*/
175-
export function isServiceBusError(
176-
err: Error | AmqpError | ServiceBusError
177-
): err is ServiceBusError {
178-
return (err as Error | ServiceBusError).name === "ServiceBusError";
175+
export function isServiceBusError(err: any): err is ServiceBusError {
176+
return err?.name === "ServiceBusError";
179177
}

0 commit comments

Comments
 (0)