Skip to content

Commit c48a716

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 c48a716

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
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+
3840
import java.util.ArrayList;
3941
import java.util.EnumSet;
4042
import java.util.List;
@@ -456,17 +458,22 @@ public Integer[] numArgs() {
456458

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

467474
@Override
468475
public Class<? extends CREThrowable>[] thrown() {
469-
return new Class[]{CRECastException.class};
476+
return new Class[]{CRECastException.class, CREBindException.class, CREIllegalArgumentException.class};
470477
}
471478

472479
@Override

0 commit comments

Comments
 (0)