Event: More detailed errors for non-cancellable events

This commit is contained in:
Dylan K. Taylor 2018-12-31 21:29:22 +00:00
parent 1cbb31f1db
commit 9ed1b5ca7f

View File

@ -50,7 +50,7 @@ abstract class Event{
*/
public function isCancelled() : bool{
if(!($this instanceof Cancellable)){
throw new \BadMethodCallException("Event is not Cancellable");
throw new \BadMethodCallException(get_class($this) . " is not Cancellable");
}
/** @var Event $this */
@ -64,7 +64,7 @@ abstract class Event{
*/
public function setCancelled(bool $value = true) : void{
if(!($this instanceof Cancellable)){
throw new \BadMethodCallException("Event is not Cancellable");
throw new \BadMethodCallException(get_class($this) . " is not Cancellable");
}
/** @var Event $this */