Skip to content

Commit

Permalink
Correct return of error xml on GET
Browse files Browse the repository at this point in the history
  • Loading branch information
danchang committed May 20, 2012
1 parent de45b69 commit f133a8a
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
Expand Up @@ -130,7 +130,7 @@ public Representation represent(Variant variant) throws ResourceException {
agentGroupRestInfo = createAgentGroupRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Agent Group failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Agent Group failed", exception.getLocalizedMessage());
}

return new OpenAcdAgentGroupRepresentation(variant.getMediaType(), agentGroupRestInfo);
Expand Down
Expand Up @@ -140,7 +140,7 @@ public Representation represent(Variant variant) throws ResourceException {
agentRestInfo = createAgentRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Agent failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Agent failed", exception.getLocalizedMessage());
}

return new OpenAcdAgentRepresentation(variant.getMediaType(), agentRestInfo);
Expand Down
Expand Up @@ -124,7 +124,7 @@ public Representation represent(Variant variant) throws ResourceException {
clientRestInfo = createClientRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Client failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Client failed", exception.getLocalizedMessage());
}

return new OpenAcdClientRepresentation(variant.getMediaType(), clientRestInfo);
Expand Down
Expand Up @@ -134,7 +134,7 @@ public Representation represent(Variant variant) throws ResourceException {
lineRestInfo = createLineRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Line failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Line failed", exception.getLocalizedMessage());
}

return new OpenAcdLineRepresentation(variant.getMediaType(), lineRestInfo);
Expand Down
Expand Up @@ -129,7 +129,7 @@ public Representation represent(Variant variant) throws ResourceException {
queueGroupRestInfo = createQueueGroupRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Queue Group failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Queue Group failed", exception.getLocalizedMessage());
}

return new OpenAcdQueueGroupRepresentation(variant.getMediaType(), queueGroupRestInfo);
Expand Down
Expand Up @@ -126,7 +126,7 @@ public Representation represent(Variant variant) throws ResourceException {
releaseCodeRestInfo = createReleaseCodeRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Release Code failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Release Code failed", exception.getLocalizedMessage());
}

return new OpenAcdReleaseCodeRepresentation(variant.getMediaType(), releaseCodeRestInfo);
Expand Down
Expand Up @@ -97,7 +97,7 @@ public Representation represent(Variant variant) throws ResourceException {
settingRestInfo = createSettingRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Settings failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Settings failed", exception.getLocalizedMessage());
}

return new OpenAcdSettingRepresentation(variant.getMediaType(), settingRestInfo);
Expand Down
Expand Up @@ -127,7 +127,7 @@ public Representation represent(Variant variant) throws ResourceException {
skillGroupRestInfo = createSkillGroupRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Skill Group failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Skill Group failed", exception.getLocalizedMessage());
}

return new OpenAcdSkillGroupRepresentation(variant.getMediaType(), skillGroupRestInfo);
Expand Down
Expand Up @@ -124,7 +124,7 @@ public Representation represent(Variant variant) throws ResourceException {
skillRestInfo = createSkillRestInfo(idInt);
}
catch (Exception exception) {
OpenAcdUtilities.setResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Skills failed", exception.getLocalizedMessage());
return OpenAcdUtilities.getResponseError(getResponse(), OpenAcdUtilities.ResponseCode.ERROR_READ_FAILED, "Read Skills failed", exception.getLocalizedMessage());
}

return new OpenAcdSkillRepresentation(variant.getMediaType(), skillRestInfo);
Expand Down

0 comments on commit f133a8a

Please sign in to comment.