/** * @param $data The json object you got from json_decode("json string") * @return FaultInfo * @throws \Exception */ public static function unmarshallJsonObject($data) { try { $retrySame = null; if (isset($data->retrySameLocation)) { $retrySame = FaultInfoUnmarshaller::unmarshallRetry($data->retrySameLocation); } $retryOther = null; if (isset($data->retryOtherLocations)) { $retryOther = FaultInfoUnmarshaller::unmarshallRetry($data->retryOtherLocations); } return new FaultInfo($data->faultCause, new Blame($data->blame), $data->message, isset($data->applicationErrorCode) ? $data->applicationErrorCode : null, isset($data->incidentId) ? $data->incidentId : null, $retrySame, $retryOther); //httpStatusCode\":401,\"httpStatusMeaning\":\"Unauthorized\"}" } catch (\Exception $e) { throw new \Exception("Failed unmarshalling json object into FaultInfo!", 0, $e); } }