@Override
    public int handleExecutionException(Exception ex, CommandLine commandLine, ParseResult parseResult)
            throws Exception {
        logger.error("Caught Error: ", ex);

        if (!(ex instanceof HyscaleException)) {
            WorkflowLogger.footer();
            String logDir = SetupConfig.getMountPathOf(SetupConfig.getToolLogDir());
            logDir = WindowsUtil.updateToHostFileSeparator(logDir);
            WorkflowLogger.error(ControllerActivity.UNEXPECTED_ERROR, logDir);
            WorkflowLogger.footer();
        }

        if (ex instanceof HyscaleException) {
            WorkflowLogger.error(ControllerActivity.TROUBLESHOOT, ex.toString());
        }

        return exitCodeExceptionMapper.getExitCode(ex);

    }
Utility Class to handle exception

@author tushart
workflow-controller/controller-service/src/main/java/io/hyscale/controller/exception/ExceptionHandler.java