File tree 2 files changed +16
-0
lines changed
cloud-core/src/main/java/cloud/commandframework/arguments/compound 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [ Unreleased]
8
8
9
+ ### Added
10
+ - Core: Expose failure reason when flag parsing fails ([ #380 ] ( https://github.com/Incendo/cloud/pull/380 ) )
11
+
9
12
## [ 1.7.1]
10
13
11
14
### Added
Original file line number Diff line number Diff line change @@ -483,6 +483,7 @@ public static final class FlagParseException extends ParserException {
483
483
484
484
private static final long serialVersionUID = -7725389394142868549L ;
485
485
private final String input ;
486
+ private final FailureReason failureReason ;
486
487
487
488
/**
488
489
* Construct a new flag parse exception
@@ -504,6 +505,7 @@ public FlagParseException(
504
505
CaptionVariable .of ("flag" , input )
505
506
);
506
507
this .input = input ;
508
+ this .failureReason = failureReason ;
507
509
}
508
510
509
511
/**
@@ -514,6 +516,17 @@ public FlagParseException(
514
516
public String getInput () {
515
517
return this .input ;
516
518
}
519
+
520
+ /**
521
+ * Returns the reason why the flag parsing failed.
522
+ *
523
+ * @return the failure reason
524
+ * @since 1.8.0
525
+ */
526
+ @ API (status = API .Status .STABLE , since = "1.8.0" )
527
+ public @ NonNull FailureReason failureReason () {
528
+ return this .failureReason ;
529
+ }
517
530
}
518
531
519
532
You can’t perform that action at this time.
0 commit comments