Added API post debugging

This commit is contained in:
Justin Foell
2021-11-26 09:47:16 -06:00
parent 3b78e20f8d
commit 410afb7554
+15
View File
@@ -45,6 +45,21 @@ class WPStrava_API {
$response = wp_remote_post( $url . $uri, $args );
if ( WPSTRAVA_DEBUG ) {
// phpcs:disable WordPress.PHP.DevelopmentFunctions -- Debug output.
error_log(
print_r(
array(
'url' => $url . $uri,
'args' => $args,
'response' => $response,
),
true
)
);
// phpcs:enable
}
if ( is_wp_error( $response ) ) {
throw WPStrava_Exception::from_wp_error( $response );
}