PHP Error "Cannot use object of type WP_Error"

I got this error and my page breaks completely :frowning:

Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in root/ Stack trace: #0 root/ Patreon_API->__get_json(‘current_user’) #1 root/ Patreon_API->fetch_user() #2 root/ Patreon_Wordpress::getPatreonUser(Object(WP_User)) #3 root/ Patreon_Wordpress->updatePatreonUser(’’) #4 root/ WP_Hook->apply_filters(NULL, Array) #5 root/ WP_Hook->do_action(Array) #6 root/ in root/ on line 44

Hey @sekra24!

Thanks for bringing that to our attention. I’ll discuss this with the team and we’ll get you an update as soon as we have had a chance to review.

1 Like

This error happens when WP is not able to contact Patreon API and WP returns an error instead of the API call result.

Have you entered all your credentials correctly, without spaces?

@nperickson @codebard This was a temporary issue. I think patreon was maintaining their API so the connection could not be established. Mybe it would be better to handle the error any other way because I don’t want my site broken everytime patreon updates their API :smiley:

You know what I mean? Greetings

1 Like