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

[RFE] Improve Error Handling For Subscribe #58

Closed
mitchwadair opened this issue Sep 12, 2022 · 0 comments · Fixed by #59
Closed

[RFE] Improve Error Handling For Subscribe #58

mitchwadair opened this issue Sep 12, 2022 · 0 comments · Fixed by #59
Assignees
Labels
enhancement New feature or request

Comments

@mitchwadair
Copy link
Owner

mitchwadair commented Sep 12, 2022

Is your feature request related to a problem? Please describe.
As described in #57, it is pretty unclear why a subscription would fail to be made.

When making a request to subscribe without proper authorization, the message looks like so:

{
  error: 'Forbidden',
  status: 403,
  message: 'subscription missing proper authorization'
}

When making a request to subscribe and there is already and existing subscription that matches the type and condition, the message looks like so:

{
  error: 'Conflict',
  status: 409,
  message: 'subscription already exists'
}

TESjs is too optimistic in assuming developers will know to give correct auth scopes to their client, and that subscriptions are cleaned up and so passes the data naively to the subscription queue assuming it was OK.

Describe the solution you'd like
Provide a more clear error on a non-OK response.

Additional context
#57

@mitchwadair mitchwadair added the enhancement New feature or request label Sep 12, 2022
@mitchwadair mitchwadair self-assigned this Sep 12, 2022
mitchwadair added a commit that referenced this issue Sep 13, 2022
#58: Only Queue Subscription if Response OK
@mitchwadair mitchwadair changed the title [RFE] Improve Error Handling For Missing Scopes [RFE] Improve Error Handling For Subscribe Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant