From ad41469d87e3d270c043f94ec748e55967f11817 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 2 Nov 2018 06:44:03 -0400 Subject: [PATCH] Log delivery errors --- includes/server/deliver.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/server/deliver.php b/includes/server/deliver.php index bd398b4..c492331 100644 --- a/includes/server/deliver.php +++ b/includes/server/deliver.php @@ -150,6 +150,14 @@ function post_activity_to_inboxes( $actor_id, $activity, $recipients ) { 'data_format' => 'body', ); $response = wp_remote_post( $inbox, $args ); + if ( is_wp_error( $response ) ) { + \error_log( + "[Pterotype] Error delivering to $inbox: {$response->get_error_message()}" + ); + } else if ( $response['response']['code'] >= 400 ) { + $res_string = print_r( $response, true ); + \error_log( "[Pterotype] Error response from $inbox: $res_string" ); + } } } }