lib/dry/struct/errors.rb in dry-struct-0.4.0 vs lib/dry/struct/errors.rb in dry-struct-0.5.0

- old
+ new

@@ -9,7 +9,14 @@ # attribute name that is the same as previously defined one def initialize(key) super("Attribute :#{key} has already been defined") end end + + # Raised when a struct doesn't have an attribute + class MissingAttributeError < KeyError + def initialize(key) + super("Missing attribute: #{ key.inspect }") + end + end end end