aws/aws-sdk-php — pull request #143 by pcolby (2013-09-04 09:53:43+00:00)
Title: Handle missing / invalid POST data in Aws\Sns\MessageValidator\Message::fromRawPostData, in a way that is much easier to catch / handle.

Prior to this change, calling [Message::fromRawPostData](http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.Sns.MessageValidator.Message.html#_fromRawPostData) with no POST data, or POST data that is either not valid JSON, or a JSON value other than a JSON object or array, then the internal call to [Message::fromArray](http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.Sns.MessageValidator.Message.html#_fromArray) will be passed a non-array, resulting in a "catchable fatal error" [(E_RECOVERABLE_ERROR)](http://php.net/manual/en/errorfunc.constants.php) - not a PHP [Exception](http://docs.php.net/manual/en/class.exception.php), but an error that requires a handler to be set via [set_error_handler](http://docs.php.net/manual/en/function.set-error-handler.php) to be handled correctly. This is both inconvenient, and very difficult to manage as part of any complex project.

This change prevents the "catchable fatal error", and throws an [Aws\Common\Exception\UnexpectedValueException](http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.Common.Exception.UnexpectedValueException.html) instead.