NetworkInventoryAction: shorten exception message

This is logged with the network session's logger, which provides context information already.
This commit is contained in:
Dylan K. Taylor 2019-06-15 14:27:11 +01:00
parent 50a7fc0ba3
commit 4bbf1d56dc

View File

@ -173,7 +173,7 @@ class NetworkInventoryAction{
return new SlotChangeAction($window, $this->inventorySlot, $this->oldItem, $this->newItem); return new SlotChangeAction($window, $this->inventorySlot, $this->oldItem, $this->newItem);
} }
throw new \UnexpectedValueException("Player " . $player->getName() . " has no open container with window ID $this->windowId"); throw new \UnexpectedValueException("No open container with window ID $this->windowId");
case self::SOURCE_WORLD: case self::SOURCE_WORLD:
if($this->inventorySlot !== self::ACTION_MAGIC_SLOT_DROP_ITEM){ if($this->inventorySlot !== self::ACTION_MAGIC_SLOT_DROP_ITEM){
throw new \UnexpectedValueException("Only expecting drop-item world actions from the client!"); throw new \UnexpectedValueException("Only expecting drop-item world actions from the client!");
@ -208,7 +208,7 @@ class NetworkInventoryAction{
} }
//TODO: more stuff //TODO: more stuff
throw new \UnexpectedValueException("Player " . $player->getName() . " has no open container with window ID $this->windowId"); throw new \UnexpectedValueException("No open container with window ID $this->windowId");
default: default:
throw new \UnexpectedValueException("Unknown inventory source type $this->sourceType"); throw new \UnexpectedValueException("Unknown inventory source type $this->sourceType");
} }