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

Rescued errors come back with all nil values? #294

Closed
gregblass opened this issue Apr 7, 2020 · 8 comments
Closed

Rescued errors come back with all nil values? #294

gregblass opened this issue Apr 7, 2020 · 8 comments

Comments

@gregblass
Copy link

Has anyone ever seen this?

Gibbon::MailChimpError: the server responded with status 404 @title=nil, @detail=nil, @body=nil, @raw_body=nil, @status_code=nil

I'm simply doing a rescue Gibbon::MailChimpError => e

Thanks in advance!

@ckornaros
Copy link

@gregblass Yes I have the same issue. On debug mode I'm able to see the "real" reason of the exception but Gibbon seems to have a issue to parse the error.

@gregblass
Copy link
Author

gregblass commented Apr 8, 2020 via email

@gregblass
Copy link
Author

Really the core of my issue is finding out if the user is unsubscribed. Does anyone have a recommended way of doing that? I can't seem to see the details any of the errors coming back.

@gregblass
Copy link
Author

gregblass commented Apr 8, 2020

Nevermind, I was able to easily find this in the Mailchimp API documentation:

https://mailchimp.com/developer/guides/manage-subscribers-with-the-mailchimp-api/

Just needed to go to sleep 😆

If there's anything I can do to potentially contribute here on the error parsing, I'm using this for two projects - and in some particular cases, it would be very useful to see what the errors are in cases where they're coming back as nil values.

I'm assuming that the issue is complex though?

@amro
Copy link
Owner

amro commented Apr 8, 2020

This may not be too tricky to figure out. I’ll try to take a look soon. Can you confirm how to repro? Just trigger a 404 by hitting a nonexistent api endpoint?

@gregblass
Copy link
Author

Let me remember which ones were doing it again. It may actually be triggered by trying to do stuff on unsubscribed list members...in which case...just check first. So it may actually not be an issue after all.

I'll confirm this and circle back.

@ckornaros
Copy link

@gregblass The problem seems to be on version 3.2.0. I update to the last 3.3.3 and the error is correctly parse and available to let you handle errors depending on status, title or detail (or anything you want) 👍

@amro
Copy link
Owner

amro commented Apr 8, 2020

Glad to hear it’s the issue that was already fixed 👍🏽

@amro amro closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants