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 RestApiException
asRestApiException(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 newRestApiException
is wrapped arounde
.e
- exception being handled.- Returns:
e
if it is already aRestApiException
, otherwise a newRestApiException
wrapped arounde
.- Throws:
RuntimeException
- ife
is a runtime exception, it is rethrown as-is.
-
-