Skip to content

Commit

Permalink
[service-bus] loosens parameter type in isServiceBusError type guard (#…
Browse files Browse the repository at this point in the history
…12493)

* [service-bus] loosens paramter type in isServiceBusError type guard

* change unknown to any
  • Loading branch information
chradek authored Nov 12, 2020
1 parent c23212d commit 62c1827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
```ts

import { AmqpAnnotatedMessage } from '@azure/core-amqp';
import { AmqpError } from 'rhea-promise';
import { delay } from '@azure/core-amqp';
import { Delivery } from 'rhea-promise';
import { HttpResponse } from '@azure/core-http';
Expand Down Expand Up @@ -136,7 +135,7 @@ export interface GetMessageIteratorOptions extends OperationOptionsBase {
}

// @public
export function isServiceBusError(err: Error | AmqpError | ServiceBusError): err is ServiceBusError;
export function isServiceBusError(err: any): err is ServiceBusError;

// @public
export interface MessageHandlers {
Expand Down
6 changes: 2 additions & 4 deletions sdk/servicebus/service-bus/src/serviceBusError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ export function translateServiceBusError(err: AmqpError | Error): ServiceBusErro
*
* @param err An error to check to see if it's of type ServiceBusError
*/
export function isServiceBusError(
err: Error | AmqpError | ServiceBusError
): err is ServiceBusError {
return (err as Error | ServiceBusError).name === "ServiceBusError";
export function isServiceBusError(err: any): err is ServiceBusError {
return err?.name === "ServiceBusError";
}

0 comments on commit 62c1827

Please sign in to comment.