diff --git a/Lib9c/Action/ItemEnhancement.cs b/Lib9c/Action/ItemEnhancement.cs index 6bd570464e..a803ead253 100644 --- a/Lib9c/Action/ItemEnhancement.cs +++ b/Lib9c/Action/ItemEnhancement.cs @@ -219,7 +219,7 @@ public override IWorld Execute(IActionContext context) { if (HammerBannedTypes.Contains(enhancementEquipment.ItemSubType)) { - throw new InvalidItemCountException(); + throw new InvalidItemTypeException($"target equipment({enhancementEquipment.ItemSubType}) does not allow use hammer"); } int hammerCount = 0; @@ -229,7 +229,7 @@ public override IWorld Execute(IActionContext context) { if (!HammerIds.Contains(kv.Key)) { - throw new InvalidItemCountException(); + throw new InvalidItemCountException("target material is not hammer"); } hammerCount += kv.Value; @@ -237,7 +237,7 @@ public override IWorld Execute(IActionContext context) if (hammerCount <= 0) { - throw new InvalidItemCountException(); + throw new InvalidItemCountException("hammer must be greater than 0"); } } @@ -327,6 +327,12 @@ public override IWorld Execute(IActionContext context) var exp = Equipment.GetHammerExp(hammerId, enhancementCostSheet); hammerExp += exp * hammerCount; } + else + { + throw new NotEnoughMaterialException( + $"{addressesHex} Aborted as the signer does not have a necessary material ({hammerId})." + ); + } } enhancementEquipment.Exp += hammerExp;