Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Service Bus] isServiceBusError should not expose AmqpError which is an internal type #12264

Closed
ramya-rao-a opened this issue Nov 4, 2020 · 3 comments · Fixed by #12493
Closed
Assignees
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Service Bus

Comments

@ramya-rao-a
Copy link
Contributor

In #12237, we introduced the ServiceBusError along with a helpful isServiceBusError() method. As discussed in #12237 (comment), the AmqpError type used here is internal to the package and the user need not be aware of it.

This issue is to track the work to not expose AmqpError to the user

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 4, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 4, 2020
@ramya-rao-a ramya-rao-a added the Client This issue points to a problem in the data-plane of the library. label Nov 4, 2020
@ramya-rao-a ramya-rao-a added this to the [2020] December milestone Nov 4, 2020
@richardpark-msft
Copy link
Member

One easy fix here is just to remove it altogether and accept AmqpError more broadly - we do a .name field check for ServiceBusError so it's unlikely that it'd get caught in our existing filter.

@chradek
Copy link
Contributor

chradek commented Nov 11, 2020

What about changing isServiceBusError to the following?

export function isServiceBusError(
  err: unknown
): err is ServiceBusError {
  return (err as Error | ServiceBusError)?.name === "ServiceBusError";
}

I'm not sure why we'd have to type err given this function is a type guard.

@ramya-rao-a
Copy link
Contributor Author

That works for me

@ramya-rao-a ramya-rao-a added the blocking-release Blocks release label Nov 12, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Service Bus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants