Skip to content

Commit 0f261d9

Browse files
authored
Expose CommandPermission in NoPermissionException (#469)
1 parent fb5473c commit 0f261d9

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

cloud-core/src/main/java/cloud/commandframework/exceptions/NoPermissionException.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,25 @@ public final String getMessage() {
6767
* Get the missing permission node
6868
*
6969
* @return Get the missing permission node
70+
* @deprecated use {@link #missingPermission()} instead
7071
*/
72+
@API(status = API.Status.DEPRECATED, since = "1.9.0")
73+
@Deprecated
7174
public @NonNull String getMissingPermission() {
7275
return this.missingPermission.toString();
7376
}
7477

78+
/**
79+
* Returns the missing {@link CommandPermission}
80+
*
81+
* @return the missing permission
82+
* @since 1.9.0
83+
*/
84+
@API(status = API.Status.STABLE, since = "1.9.0")
85+
public @NonNull CommandPermission missingPermission() {
86+
return this.missingPermission;
87+
}
88+
7589
@Override
7690
public final synchronized Throwable fillInStackTrace() {
7791
return this;

0 commit comments

Comments
 (0)