fix error message suppression on tooling client
This commit is contained in:
parent
2dff99e99b
commit
b9664caec0
|
@ -516,7 +516,7 @@ public class FHIRToolingClient {
|
||||||
return p_out;
|
return p_out;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleException("Error performing operation '"+name+"' with parameters " + ps, e);
|
handleException("Error performing operation '"+name+": "+e.getMessage()+"' (parameters = \"" + ps+"\")", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -517,7 +517,7 @@ public class FHIRToolingClient {
|
||||||
return p_out;
|
return p_out;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleException("Error performing operation '"+name+"' with parameters " + ps, e);
|
handleException("Error performing operation '"+name+": "+e.getMessage()+"' (parameters = \"" + ps+"\")", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,7 +504,7 @@ public class FHIRToolingClient {
|
||||||
return p_out;
|
return p_out;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleException("Error performing operation '"+name+"' with parameters " + ps, e);
|
handleException("Error performing operation '"+name+": "+e.getMessage()+"' (parameters = \"" + ps+"\")", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -507,7 +507,7 @@ public class FHIRToolingClient {
|
||||||
return p_out;
|
return p_out;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleException("Error performing operation '"+name+"' with parameters " + ps, e);
|
handleException("Error performing operation '"+name+": "+e.getMessage()+"' (parameters = \"" + ps+"\")", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,28 +261,28 @@ public class FHIRToolingClient {
|
||||||
String ps = "";
|
String ps = "";
|
||||||
try {
|
try {
|
||||||
if (!complex)
|
if (!complex)
|
||||||
for (ParametersParameterComponent p : params.getParameter())
|
for (ParametersParameterComponent p : params.getParameter())
|
||||||
if (p.getValue() instanceof PrimitiveType)
|
if (p.getValue() instanceof PrimitiveType)
|
||||||
ps += p.getName() + "=" + Utilities.encodeUri(((PrimitiveType) p.getValue()).asStringValue()) + "&";
|
ps += p.getName() + "=" + Utilities.encodeUri(((PrimitiveType) p.getValue()).asStringValue()) + "&";
|
||||||
ResourceRequest<T> result;
|
ResourceRequest<T> result;
|
||||||
if (complex) {
|
if (complex) {
|
||||||
result = client.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
|
result = client.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
|
||||||
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
||||||
} else {
|
} else {
|
||||||
result = client.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), getPreferredResourceFormat(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
result = client.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), getPreferredResourceFormat(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
|
||||||
}
|
}
|
||||||
if (result.isUnsuccessfulRequest()) {
|
if (result.isUnsuccessfulRequest()) {
|
||||||
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
|
||||||
}
|
}
|
||||||
if (result.getPayload() instanceof Parameters) {
|
if (result.getPayload() instanceof Parameters) {
|
||||||
return (Parameters) result.getPayload();
|
return (Parameters) result.getPayload();
|
||||||
} else {
|
} else {
|
||||||
Parameters p_out = new Parameters();
|
Parameters p_out = new Parameters();
|
||||||
p_out.addParameter().setName("return").setResource(result.getPayload());
|
p_out.addParameter().setName("return").setResource(result.getPayload());
|
||||||
return p_out;
|
return p_out;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleException("Error performing operation '" + name + "' with parameters " + ps, e);
|
handleException("Error performing operation '"+name+": "+e.getMessage()+"' (parameters = \"" + ps+"\")", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue