Package com.google.gerrit.server.api
Class ApiUtil
- java.lang.Object
-
- com.google.gerrit.server.api.ApiUtil
-
public class ApiUtil extends Object
Static utilities for API implementations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RestApiExceptionasRestApiException(String msg, Exception e)Convert an exception encountered during API execution to aRestApiException.
-
-
-
Method Detail
-
asRestApiException
public static RestApiException asRestApiException(String msg, Exception e) throws RuntimeException
Convert an exception encountered during API execution to aRestApiException.- Parameters:
msg- message to be used in the case where a newRestApiExceptionis wrapped arounde.e- exception being handled.- Returns:
eif it is already aRestApiException, otherwise a newRestApiExceptionwrapped arounde.- Throws:
RuntimeException- ifeis a runtime exception, it is rethrown as-is.
-
-