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

Commit

Permalink
feat: add message for xml and json response body validation exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mbagur committed May 2, 2018
1 parent 3ac3c17 commit 8e84ace
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 8e84ace

Please sign in to comment.