opscode/chef — pull request #741 by danielsdeleo (2013-04-27 00:09:11+00:00)
Title: [CHEF-3858] rescue bad json errors and re-raise as decryption failures

After some discussion with @seth about https://github.com/opscode/chef/pull/740, we decided to avoid changes (even backwards compatible ones) in the encrypted data bag item format and instead add a new format version. I'll rescind pull 740 and rework it as a new format version.

This patch instead just catches yajl parse errors and re-raises them as decryption failure errors. This will ensure that even when the decryption step returns malformed data rather than raising, the code will eventually raise the same decryption failure exception.