• One site was getting this on Friday:
    PHP message: PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /var/www/<site>/wp-content/plugins/gazchaps-woocommerce-getaddress-io/class.checkout.php:34

    My line 34 now looks like this:
    if (is_wp_error($result)) {
    $msgs = implode(‘, ‘, $result->get_error_messages());
    $output = array(
    ‘error’ =>__$msgs,
    ‘error_code’ => 401, // appropriate?
    );
    wp_die( json_encode( $output ) );
    }
    |A bit quick and dirty, I know.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter whitelamp

    (@whitelamp)

    That should read:
    ‘error’ => $msgs,

    Plugin Author gazchap

    (@gazchap)

    Thanks for the report.

    What were the error messages being reported in the WP_Error, do you know?

    401 probably not appropriate, I’d most likely just set $result[‘response’][‘code’] to 500 in this instance to trigger the “server error” response, as this is probably what it is – (but if you have any “live” examples of the contents of the WP_Error object that you can send me, that’d be awesome)

    Thread Starter whitelamp

    (@whitelamp)

    Afraid I have no idea what the error was; but I have added a mail() so if it happens again the error messages will appear in my inbox. And I will let you know. But AFAIK this is the first time in over 12 months we have had an issue.
    So it could be a long wait.

    Thread Starter whitelamp

    (@whitelamp)

    I’ve had a reported error today:
    cURL error 6: Could not resolve host: api.getaddress.io

    Plugin Author gazchap

    (@gazchap)

    Cheers. I figured the error would be something like that.

    I’ll add a patch that fixes the type error and add a new error state for if the API server couldn’t be contacted.

    Thanks for the report.

    Thread Starter whitelamp

    (@whitelamp)

    It’s odd – they claim 100% uptime this month:
    https://stats.pingdom.com/4ql0hawg3xkk/1562420/2020/11

    Plugin Author gazchap

    (@gazchap)

    That only checks every minute though, so a short enough blip might not be spotted.

    Either that, or the connection issue is an outgoing issue from your server rather than an incoming one on theirs, but either way my plugin should be able to deal with it appropriately so I’ll get a patch sorted ??

    Thread Starter whitelamp

    (@whitelamp)

    I’ve contacted the hosting company…

    Thread Starter whitelamp

    (@whitelamp)

    And another.
    cURL error 28: Operation timed out after 5001 milliseconds with 0 bytes received
    I checked the mail logs for last week and found that on Friday, MX lookups for gmail.com were failing.

    I think there’s something up at the datacentre.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Fatal error’ is closed to new replies.