Class ApiUtil


  • public class ApiUtil
    extends Object
    Static utilities for API implementations.
    • Method Detail

      • asRestApiException

        public static RestApiException asRestApiException​(String msg,
                                                          Exception e)
                                                   throws RuntimeException
        Convert an exception encountered during API execution to a RestApiException.
        Parameters:
        msg - message to be used in the case where a new RestApiException is wrapped around e.
        e - exception being handled.
        Returns:
        e if it is already a RestApiException, otherwise a new RestApiException wrapped around e.
        Throws:
        RuntimeException - if e is a runtime exception, it is rethrown as-is.