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

Meetup.com: API errors on RSVPing should return friendlier error messages #921

Closed
jamietanna opened this issue Feb 17, 2020 · 1 comment
Closed
Labels

Comments

@jamietanna
Copy link
Contributor

As per Ryan's comment on chat we should return the human-readable error in the payload to the user

@snarfed
Copy link
Owner

snarfed commented Apr 26, 2020

specifically, here are the example error messages i hit, from 2020-02-17 #indieweb-dev:

  • when i try to rsvp to a group's event that i'm not a member of: Error: {"errors":[{"code":"member_error","message":"Invalid member"}]} HTTP Error 400: Bad Request
  • when i rsvp to a nonexistent url (that passes the regex): Error: {"errors":[{"code":"group_error","message":"Invalid group urlname xyz"}]} HTTP Error 404: Not Found

the catch is that these are urllib.error.HTTPErrors that propagate all the way up to publish.py, where they're caught and returned as user-visible error messages:

msg = 'Error: %s %s' % (body or '', e)

the catch is, we want to parse the response body as JSON there and pull out the message field(s) and only show them, but that's specific to the meetup API. so maybe we'd do it here, in granary:

https://github.com/snarfed/granary/blob/d6846f0d1260dd4513464e481c46437cf813c77a/granary/meetup.py#L120-L123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants