File exportedFile = exportService.exportProject(request);
File exportedFile = exportService.exportProject(request);
@Override public void run() { File file; try { // We are in a new thread. Set up thread-specific MDC MDC.put(Logging.KEY_USERNAME, username); MDC.put(Logging.KEY_PROJECT_ID, String.valueOf(model.getProject().getId())); MDC.put(Logging.KEY_REPOSITORY_PATH, documentService.getDir().toString()); state = State.RUNNING; file = exportService.exportProject(model); fileName = file.getAbsolutePath(); projectName = model.getProject().getName(); state = State.COMPLETED; } catch (ClosedByInterruptException e) { cancel(); } catch (Throwable e) { LOG.error("Unexpected error during project export", e); model.addMessage(LogMessage.error(this, "Unexpected error during project export: %s", ExceptionUtils.getRootCauseMessage(e))); state = State.FAILED; // This marks the progression as complete and causes ProgressBar#onFinished // to be called where we display the messages model.progress = 100; } }
@Override public void run() { File file; try { // We are in a new thread. Set up thread-specific MDC MDC.put(Logging.KEY_USERNAME, username); MDC.put(Logging.KEY_PROJECT_ID, String.valueOf(model.getProject().getId())); MDC.put(Logging.KEY_REPOSITORY_PATH, documentService.getDir().toString()); state = State.RUNNING; file = exportService.exportProject(model); fileName = file.getAbsolutePath(); projectName = model.getProject().getName(); state = State.COMPLETED; } catch (ClosedByInterruptException e) { cancel(); } catch (Throwable e) { LOG.error("Unexpected error during project export", e); model.addMessage(LogMessage.error(this, "Unexpected error during project export: %s", ExceptionUtils.getRootCauseMessage(e))); state = State.FAILED; // This marks the progression as complete and causes ProgressBar#onFinished // to be called where we display the messages model.progress = 100; } }