| | |
| | | import org.opends.quicksetup.CliApplication; |
| | | import static org.opends.quicksetup.Installation.*; |
| | | |
| | | import org.opends.quicksetup.ApplicationReturnCode; |
| | | import org.opends.quicksetup.WizardStep; |
| | | import org.opends.quicksetup.ProgressStep; |
| | | import org.opends.quicksetup.ApplicationException; |
| | |
| | | LOG.log(Level.INFO, |
| | | "Error starting server in order to apply custom" + |
| | | "schema and/or configuration", e); |
| | | throw new ApplicationException(ApplicationException.Type.APPLICATION, |
| | | getMsg("error-starting-server"), e); |
| | | throw new ApplicationException( |
| | | ApplicationReturnCode.ReturnCode.APPLICATION_ERROR, |
| | | getMsg("error-starting-server"), e); |
| | | } |
| | | |
| | | checkAbort(); |
| | |
| | | LOG.log(Level.INFO, "server stopped"); |
| | | } catch (Throwable t) { |
| | | LOG.log(Level.INFO, "Error stopping server", t); |
| | | throw new ApplicationException(ApplicationException.Type.BUG, |
| | | throw new ApplicationException(ApplicationReturnCode.ReturnCode.BUG, |
| | | getMsg("error-stopping-server"), t); |
| | | } |
| | | } |
| | |
| | | Utils.listToString(errors, |
| | | Constants.LINE_SEPARATOR, /*bullet=*/"\u2022 ", ""); |
| | | ApplicationException ae = new ApplicationException( |
| | | ApplicationException.Type.APPLICATION, |
| | | ApplicationReturnCode.ReturnCode.APPLICATION_ERROR, |
| | | getMsg("error-upgraded-server-starts-with-errors", |
| | | Constants.LINE_SEPARATOR + formattedDetails), null); |
| | | UserInteraction ui = userInteraction(); |
| | |
| | | int port = getInstallation().getCurrentConfiguration().getPort(); |
| | | if (port != -1 && !Utils.canUseAsPort(port)) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.APPLICATION, |
| | | ApplicationReturnCode.ReturnCode.APPLICATION_ERROR, |
| | | getMsg("error-port-in-use", Integer.toString(port)), |
| | | null); |
| | | } |
| | |
| | | } catch (IOException ioe) { |
| | | LOG.log(Level.INFO, "error determining if server running"); |
| | | this.runWarning = new ApplicationException( |
| | | ApplicationException.Type.TOOL_ERROR, |
| | | ApplicationReturnCode.ReturnCode.TOOL_ERROR, |
| | | getMsg("error-server-status"), ioe); |
| | | } |
| | | |
| | |
| | | |
| | | // We don't consider a user cancelation exception |
| | | // to be an error. |
| | | if (ae.getType() != ApplicationException.Type.CANCEL) { |
| | | if (ae.getType() != ApplicationReturnCode.ReturnCode.CANCELLED) { |
| | | this.runError = ae; |
| | | } else { |
| | | this.abort = true; |
| | |
| | | |
| | | } catch (Throwable t) { |
| | | this.runError = |
| | | new ApplicationException(ApplicationException.Type.BUG, |
| | | new ApplicationException(ApplicationReturnCode.ReturnCode.BUG, |
| | | getMsg("bug-msg"), t); |
| | | } finally { |
| | | try { |
| | |
| | | |
| | | private void checkAbort() throws ApplicationException { |
| | | if (abort) throw new ApplicationException( |
| | | ApplicationException.Type.CANCEL, |
| | | ApplicationReturnCode.ReturnCode.CANCELLED, |
| | | getMsg("upgrade-canceled"), null); |
| | | } |
| | | |
| | |
| | | throw ae; |
| | | } catch (Exception e) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | getMsg("error-backup-filesystem"), |
| | | e); |
| | | } |
| | |
| | | int ret = output.getReturnCode(); |
| | | if (ret != 0) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.TOOL_ERROR, |
| | | ApplicationReturnCode.ReturnCode.TOOL_ERROR, |
| | | getMsg("error-backup-db-tool-return-code", |
| | | Integer.toString(ret)), |
| | | null); |
| | |
| | | throw ae; |
| | | } catch (Exception e) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.TOOL_ERROR, |
| | | ApplicationReturnCode.ReturnCode.TOOL_ERROR, |
| | | getMsg("error-backup-db"), e); |
| | | } |
| | | } |
| | |
| | | throw ae; |
| | | } catch (Exception e) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | getMsg("error-initializing-upgrade"), e); |
| | | } |
| | | } |