Added extra Exceptions

This commit is contained in:
Shoghi Cervantes
2014-10-28 21:07:12 +01:00
parent b6f7ee20fc
commit 8c4faa8622
37 changed files with 215 additions and 87 deletions

View File

@ -90,7 +90,7 @@ class HandlerList{
return;
}
if(isset($this->handlerSlots[$listener->getPriority()][spl_object_hash($listener)])){
throw new \Exception("This listener is already registered to priority " . $listener->getPriority());
throw new \InvalidStateException("This listener is already registered to priority " . $listener->getPriority());
}
$this->handlers = null;
$this->handlerSlots[$listener->getPriority()][spl_object_hash($listener)] = $listener;

View File

@ -76,7 +76,7 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
$this->originals = $this->modifiers;
if(!isset($this->modifiers[self::MODIFIER_BASE])){
throw new \Exception("BASE Damage modifier missing");
throw new \InvalidArgumentException("BASE Damage modifier missing");
}
}