-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41215 from gsmet/more-info-error
Quarkus Update - Provide more context when an error occurs
- Loading branch information
Showing
5 changed files
with
29 additions
and
13 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
19 changes: 15 additions & 4 deletions
19
...evtools-common/src/main/java/io/quarkus/devtools/commands/data/QuarkusCommandOutcome.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 |
---|---|---|
@@ -1,22 +1,33 @@ | ||
package io.quarkus.devtools.commands.data; | ||
|
||
import java.util.Objects; | ||
|
||
public class QuarkusCommandOutcome extends ValueMap<QuarkusCommandOutcome> { | ||
|
||
public static QuarkusCommandOutcome success() { | ||
return new QuarkusCommandOutcome(true); | ||
return new QuarkusCommandOutcome(true, null); | ||
} | ||
|
||
public static QuarkusCommandOutcome failure() { | ||
return new QuarkusCommandOutcome(false); | ||
public static QuarkusCommandOutcome failure(String message) { | ||
Objects.requireNonNull(message, "Message may not be null in case of a failure"); | ||
|
||
return new QuarkusCommandOutcome(false, message); | ||
} | ||
|
||
private final boolean success; | ||
|
||
public QuarkusCommandOutcome(boolean success) { | ||
private final String message; | ||
|
||
private QuarkusCommandOutcome(boolean success, String message) { | ||
this.success = success; | ||
this.message = message; | ||
} | ||
|
||
public boolean isSuccess() { | ||
return success; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
} |
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