Merged API-STRIKES-BACK (5.2.0) to HEAD (5.2)

126242 gjames: RA-878:All api errors should return the standard error object


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127571 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-06-02 21:40:03 +00:00
parent 00c3315166
commit f17a4d19cf
24 changed files with 382 additions and 236 deletions

View File

@@ -79,8 +79,8 @@ public class NetworksWebScriptGet extends ApiWebScript
// apply content type
res.setContentType(Format.JSON.mimetype() + ";charset=UTF-8");
jsonHelper.withWriter(res.getOutputStream(), new Writer()
assistant.getJsonHelper().withWriter(res.getOutputStream(), new Writer()
{
@Override
public void writeContents(JsonGenerator generator, ObjectMapper objectMapper)
@@ -107,17 +107,13 @@ public class NetworksWebScriptGet extends ApiWebScript
}
}, true, true);
}
catch (ApiException apiException)
catch (ApiException | WebScriptException apiException)
{
renderErrorResponse(resolveException(apiException), res);
}
catch (WebScriptException webException)
{
renderErrorResponse(resolveException(webException), res);
assistant.renderException(apiException, res);
}
catch (RuntimeException runtimeException)
{
renderErrorResponse(resolveException(runtimeException), res);
assistant.renderException(runtimeException, res);
}
}
}