We ran into an issue while refactoring the code around our usage of Gala and ended up passing corrupted hashes into Gala::PaymentToken.new this resulted in exceptions, but obtuse errors like NoMethodError: undefined method 'unpack1' for nil:NilClass. This patch changes the hash digging to use fetch, which will raise KeyErrors instead, making it more clear there was corruption.
We ran into an issue while refactoring the code around our usage of Gala and ended up passing corrupted hashes into
Gala::PaymentToken.new
this resulted in exceptions, but obtuse errors likeNoMethodError: undefined method 'unpack1' for nil:NilClass
. This patch changes the hash digging to usefetch
, which will raiseKeyError
s instead, making it more clear there was corruption.