• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 26101908636

19 May 2026 01:55PM UTC coverage: 70.982% (+0.003%) from 70.979%
26101908636

Pull #1859

github

web-flow
Merge cf4a7f717 into b4eeee25f
Pull Request #1859: #1392: Smart completions

4472 of 6964 branches covered (64.22%)

Branch coverage included in aggregate %.

11521 of 15567 relevant lines covered (74.01%)

3.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
cli/src/main/java/com/devonfw/tools/ide/cli/CliException.java
1
package com.devonfw.tools.ide.cli;
2

3
import com.devonfw.tools.ide.process.ProcessResult;
4

5
/**
6
 * {@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.
7
 * Unlike other exceptions a {@link CliException} is not treated as technical error. Therefore by default (unless in debug mode) no stacktrace is printed.
8
 */
9
public class CliException extends RuntimeException {
1✔
10

11
  private final int exitCode;
12

13
  /**
14
   * The constructor.
15
   *
16
   * @param message the {@link #getMessage() message}.
17
   */
18
  public CliException(String message) {
19

20
    this(message, 1);
4✔
21
  }
1✔
22

23
  /**
24
   * The constructor.
25
   *
26
   * @param message the {@link #getMessage() message}.
27
   * @param cause the {@link #getCause() cause}.
28
   */
29
  public CliException(String message, Throwable cause) {
30

31
    this(message, 1, cause);
5✔
32
  }
1✔
33

34
  /**
35
   * The constructor.
36
   *
37
   * @param message the {@link #getMessage() message}.
38
   * @param exitCode the {@link #getExitCode() exit code}.
39
   */
40
  public CliException(String message, int exitCode) {
41

42
    this(message, exitCode, null);
5✔
43
  }
1✔
44

45
  /**
46
   * The constructor.
47
   *
48
   * @param message the {@link #getMessage() message}.
49
   * @param exitCode the {@link #getExitCode() exit code}.
50
   * @param cause the {@link #getCause() cause}.
51
   */
52
  public CliException(String message, int exitCode, Throwable cause) {
53

54
    super(message, cause);
4✔
55
    assert (exitCode != ProcessResult.SUCCESS);
3!
56
    this.exitCode = exitCode;
3✔
57
  }
1✔
58

59
  /**
60
   * @return the exit code. Should not be zero.
61
   */
62
  public int getExitCode() {
63

64
    return this.exitCode;
×
65
  }
66

67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc