Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19 from mbagur/better-invalid-response-exception-msg
Browse files Browse the repository at this point in the history
Better message for respone body validation exception
  • Loading branch information
RETFU committed May 11, 2018
2 parents 3ac3c17 + 8e84ace commit c459428
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ public function assertResponseXML($value, $schema)
);
}
if (empty($invalidBodyError) == false) {
throw new $exceptionClassName($invalidBodyError);
throw new $exceptionClassName(
$invalidBodyError,
"Invalid XML Response body"
);
}
}
};
Expand Down Expand Up @@ -340,7 +343,8 @@ public function assertResponseJSON($value, $schema)
$validator = new JsonValidator($value, $schema);
if($validator->fails()) {
throw new InvalidResponsePayloadBodyException(
$validator->getErrors()
$validator->getErrors(),
"Invalid JSON response body"
);
}
}
Expand Down

0 comments on commit c459428

Please sign in to comment.