mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:08:34 +00:00
feat: send one of an error message during edits if otherwise squashed by LimitExtent (#2246)
* feat: send one of an error message during edits if otherwise squashed by LimitExtent * no region is not ingorable
This commit is contained in:
@ -14,6 +14,7 @@ public class FaweException extends RuntimeException {
|
||||
|
||||
private final Component message;
|
||||
private final Type type;
|
||||
private final boolean ignorable;
|
||||
|
||||
/**
|
||||
* New instance. Defaults to {@link FaweException.Type#OTHER}.
|
||||
@ -33,8 +34,19 @@ public class FaweException extends RuntimeException {
|
||||
* New instance of a given {@link FaweException.Type}
|
||||
*/
|
||||
public FaweException(Component reason, Type type) {
|
||||
this(reason, type, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* New instance of a given {@link FaweException.Type}
|
||||
*
|
||||
* @param ignorable if an edit can continue if this exception is caught, e.g. by {@link com.fastasyncworldedit.core.extent.LimitExtent}
|
||||
* @since TODO
|
||||
*/
|
||||
public FaweException(Component reason, Type type, boolean ignorable) {
|
||||
this.message = reason;
|
||||
this.type = type;
|
||||
this.ignorable = ignorable;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -55,6 +67,15 @@ public class FaweException extends RuntimeException {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* If an edit can continue if this exception is caught, e.g. by {@link com.fastasyncworldedit.core.extent.LimitExtent}
|
||||
*
|
||||
* @since TODO
|
||||
*/
|
||||
public boolean ignorable() {
|
||||
return ignorable;
|
||||
}
|
||||
|
||||
public static FaweException get(Throwable e) {
|
||||
if (e instanceof FaweException) {
|
||||
return (FaweException) e;
|
||||
|
Reference in New Issue
Block a user