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

Better message for respone body validation exception #19

Merged
merged 1 commit into from
May 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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