Skip to content

Commit a234f7c

Browse files
Copilotswissspidy
andcommitted
Improve error message format for better user experience
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 4fcf188 commit a234f7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/WP_CLI/Shell/REPL.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function start() {
3434
eval( $line );
3535
} catch ( \Throwable $e ) {
3636
// Display the error message but continue the session
37-
fwrite( STDERR, $e . "\n" );
37+
fwrite( STDERR, get_class( $e ) . ': ' . $e->getMessage() . "\n" );
3838
}
3939
$out = (string) ob_get_clean();
4040
if ( 0 < strlen( $out ) ) {
@@ -53,7 +53,7 @@ public function start() {
5353
$evl = eval( $line );
5454
} catch ( \Throwable $e ) {
5555
// Display the error message but continue the session
56-
fwrite( STDERR, $e . "\n" );
56+
fwrite( STDERR, get_class( $e ) . ': ' . $e->getMessage() . "\n" );
5757
$evl = null;
5858
}
5959
$out = (string) ob_get_clean();

0 commit comments

Comments
 (0)