From 8653dee4c702bf53116e2c47f8591a1d3b10e015 Mon Sep 17 00:00:00 2001 From: tfrommen Date: Mon, 16 Jan 2023 18:49:40 +0100 Subject: [PATCH] Print additional error message --- inc/class-response-command.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/inc/class-response-command.php b/inc/class-response-command.php index cbb89b2..631d739 100644 --- a/inc/class-response-command.php +++ b/inc/class-response-command.php @@ -408,7 +408,17 @@ private function _process_response( $args, $assoc_args ) { $saml = process_response(); if ( is_wp_error( $saml ) ) { - WP_CLI::error( $saml ); + WP_CLI::error( $saml, false ); + + $saml = instance(); + if ( $saml ) { + $error = $saml->getLastErrorReason(); + if ( $error ) { + WP_CLI::print_value( $error ); + } + } + + exit( 1 ); } return $saml;