class HttpUtils {

    public static Throwable unwrapCompletionException(Throwable ex) {
        Throwable cause = ex;
        while (cause instanceof CompletionException) {
            cause = cause.getCause();
        }

        return cause;
    }

    private  HttpUtils();

}