gala
gala copied to clipboard
Use `fetch` to require hash keys
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.