Juan Hernandez has submitted this change and it was merged.
Change subject: restapi: No NPE when no linked exception
......................................................................
restapi: No NPE when no linked exception
Some exceptions generated when posting an incorrect XML document don't
contain a linked exception. In those cases we try to reference them and
thus a NPE is produced, for example, if we post a valid but incorrect
XML document to a collection:
# curl \
--insecure \
--request POST \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "<garbage/>" \
${url}/tags
To avoid this issue this patch adds a check to the XML message body
reader, so that when these type of exceptions occur it will generate the
expected usage message instead of the NPE.
Change-Id: I7158c3d5c9d3c928209444d27c369e8753b2c840
Bug-Url:
https://bugzilla.redhat.com/1091981
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/XmlMessageBodyReader.java
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
Ravi Nori: Looks good to me, but someone else must approve
Juan Hernandez: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/27161
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7158c3d5c9d3c928209444d27c369e8753b2c840
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server