forked from devonfw/ide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into devonfw#1198-ability-to-download-custom-so…
…ftware-from-mounted-filesystem
- Loading branch information
Showing
45 changed files
with
1,375 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
ide/src/main/java/com/devonfw/tools/ide/cli/CliAbortException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.devonfw.tools.ide.cli; | ||
|
||
/** | ||
* {@link CliException} that is thrown if the user aborted further processing due | ||
*/ | ||
public final class CliAbortException extends CliException { | ||
|
||
/** | ||
* The constructor. | ||
*/ | ||
public CliAbortException() { | ||
|
||
super("Aborted by end-user.", 22); | ||
} | ||
|
||
} |
66 changes: 66 additions & 0 deletions
66
ide/src/main/java/com/devonfw/tools/ide/cli/CliException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.devonfw.tools.ide.cli; | ||
|
||
/** | ||
* {@link RuntimeException} for to abort CLI process in expected situations. It allows to abort with a defined message | ||
* for the end user and a defined exit code. Unlike other exceptions a {@link CliException} is not treated as technical | ||
* error. Therefore by default (unless in debug mode) no stacktrace is printed. | ||
*/ | ||
public class CliException extends RuntimeException { | ||
|
||
private final int exitCode; | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param message the {@link #getMessage() message}. | ||
*/ | ||
public CliException(String message) { | ||
|
||
this(message, 1); | ||
} | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param message the {@link #getMessage() message}. | ||
* @param cause the {@link #getCause() cause}. | ||
*/ | ||
public CliException(String message, Throwable cause) { | ||
|
||
this(message, 1, cause); | ||
} | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param message the {@link #getMessage() message}. | ||
* @param exitCode the {@link #getExitCode() exit code}. | ||
*/ | ||
public CliException(String message, int exitCode) { | ||
|
||
super(message); | ||
this.exitCode = exitCode; | ||
} | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param message the {@link #getMessage() message}. | ||
* @param exitCode the {@link #getExitCode() exit code}. | ||
* @param cause the {@link #getCause() cause}. | ||
*/ | ||
public CliException(String message, int exitCode, Throwable cause) { | ||
|
||
super(message, cause); | ||
this.exitCode = exitCode; | ||
} | ||
|
||
/** | ||
* @return the exit code. Should not be zero. | ||
*/ | ||
public int getExitCode() { | ||
|
||
return this.exitCode; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.