@Override
    protected void onError(WorkflowContext context, HyscaleException he) throws HyscaleException {
        WorkflowLogger.header(ControllerActivity.ERROR);
        Object troubleshootMsgObj = context.getAttribute(WorkflowConstants.TROUBLESHOOT_MESSAGE);
        StringBuilder errorMessage = new StringBuilder();
        errorMessage.append(he != null ? he.getMessage() : DeployerErrorCodes.FAILED_TO_APPLY_MANIFEST.getMessage());
        if (troubleshootMsgObj != null) {
            String troubleshootMessage = (String) troubleshootMsgObj;
            logger.error("Troubleshoot message: {}", troubleshootMessage);
            errorMessage.append(ToolConstants.NEW_LINE).append(troubleshootMessage);
        }
        WorkflowLogger.error(ControllerActivity.TROUBLESHOOT, errorMessage.toString());
        context.addAttribute(WorkflowConstants.ERROR_MESSAGE, errorMessage.toString());
        context.setFailed(true);
        if (he != null) {
            throw he;
        }
    }
Write deployment logs to file for later access

@param context
@param deploymentContext
workflow-controller/controller-service/src/main/java/io/hyscale/controller/invoker/DeployComponentInvoker.java