ResponseBuilder builder;
if (ex instanceof SyncopeClientException) {
SyncopeClientException sce = (SyncopeClientException) ex;
builder = sce.isComposite()
? getSyncopeClientCompositeExceptionResponse(sce.asComposite())
: getSyncopeClientExceptionResponse(sce);
} else if (ex instanceof WebApplicationException) {
Response response = ((WebApplicationException) ex).getResponse();
ErrorTO error = new ErrorTO();