Skip to content

Commit 9979054

Browse files
committed
Updating docs of trigger with exceptions
New exceptions are now thrown. Old ones had been ignored. Formatting the docs to the 120 character limit.
1 parent 1031c8b commit 9979054

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/main/java/com/laytonsmith/core/functions/EventBinding.java

+15-7
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@
3030
import com.laytonsmith.core.events.EventUtils;
3131
import com.laytonsmith.core.exceptions.CRE.CREBindException;
3232
import com.laytonsmith.core.exceptions.CRE.CRECastException;
33+
import com.laytonsmith.core.exceptions.CRE.CREIllegalArgumentException;
3334
import com.laytonsmith.core.exceptions.CRE.CREInsufficientArgumentsException;
3435
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
3536
import com.laytonsmith.core.exceptions.ConfigCompileException;
3637
import com.laytonsmith.core.exceptions.ConfigRuntimeException;
3738
import com.laytonsmith.core.exceptions.EventException;
39+
40+
import java.net.BindException;
3841
import java.util.ArrayList;
3942
import java.util.EnumSet;
4043
import java.util.List;
@@ -456,17 +459,22 @@ public Integer[] numArgs() {
456459

457460
@Override
458461
public String docs() {
459-
return "void {eventName, eventObject, [serverWide]} Manually triggers bound events. The event object passed to this function is "
460-
+ " sent directly as-is to the bound events. Check the documentation for each event to see what is required."
461-
+ " No checks will be done on the data here, but it is not recommended to fail to send all parameters required."
462-
+ " If serverWide is true, the event is triggered directly in the server, unless it is a CommandHelper specific"
463-
+ " event, in which case, serverWide is irrelevant. Defaults to false, which means that only CommandHelper code"
464-
+ " will receive the event.";
462+
return "void {eventName, eventObject, [serverWide]} Manually triggers bound events."
463+
+ " The event object passed to this function is sent directly as-is to the bound events."
464+
+ " Check the documentation for each event to see what is required."
465+
+ " No checks will be done on the data here,"
466+
+ " but it is not recommended to fail to send all parameters required."
467+
+ " If serverWide is true, the event is triggered directly in the server,"
468+
+ " unless it is a CommandHelper specific event, in which case, serverWide is irrelevant."
469+
+ " Defaults to false, which means that only CommandHelper code will receive the event."
470+
+ " Throws a CastException when eventObject is not an array and not null."
471+
+ " Throws a BindException when " + getName() + "() is not yet supported by the given event."
472+
+ " Throws a CREIllegalArgumentException exception, if the event does not exist.";
465473
}
466474

467475
@Override
468476
public Class<? extends CREThrowable>[] thrown() {
469-
return new Class[]{CRECastException.class};
477+
return new Class[]{CRECastException.class, BindException.class, CREIllegalArgumentException.class};
470478
}
471479

472480
@Override

0 commit comments

Comments
 (0)