11/*
2- * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
2+ * Copyright (c) 2022, 2025 Contributors to the Eclipse Foundation
33 * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
44 *
55 * This program and the accompanying materials are made available under the
@@ -321,7 +321,7 @@ public int executeCommand(String[] argv) {
321321 cmd = CLICommand .getCommand (cliContainer , command );
322322 return cmd .execute (argv );
323323 } catch (CommandValidationException cve ) {
324- logger .severe ( cve .getMessage ());
324+ logger .log ( SEVERE , cve .getMessage (), cve );
325325 if (cmd == null ) // error parsing program options
326326 {
327327 printUsage ();
@@ -331,7 +331,7 @@ public int executeCommand(String[] argv) {
331331 return ERROR ;
332332 } catch (InvalidCommandException ice ) {
333333 // find closest match with local or remote commands
334- logger .severe ( ice .getMessage ());
334+ logger .log ( SEVERE , ice .getMessage (), ice );
335335 try {
336336 po .setEcho (false );
337337 CLIUtil .displayClosestMatch (command ,
@@ -344,7 +344,7 @@ public int executeCommand(String[] argv) {
344344 } catch (CommandException ce ) {
345345 if (ce .getCause () instanceof ConnectException ) {
346346 // find closest match with local commands
347- logger .severe ( ce .getMessage ());
347+ logger .log ( SEVERE , ce .getMessage (), ce );
348348 try {
349349 CLIUtil .displayClosestMatch (command ,
350350 CLIUtil .getLocalCommands (cliContainer ),
@@ -353,7 +353,7 @@ public int executeCommand(String[] argv) {
353353 logger .info (strings .get ("InvalidRemoteCommand" , command ));
354354 }
355355 } else {
356- logger .severe ( ce .getMessage ());
356+ logger .log ( SEVERE , ce .getMessage (), ce );
357357 }
358358 return ERROR ;
359359 }
0 commit comments