public static <T> T execute(Single<T> apiCall) {
        try {
            return apiCall.blockingGet();
        } catch (HttpException e) {
            try {
                if (e.response() == null || e.response().errorBody() == null) {
                    throw e;
                }
                String errorBody = e.response().errorBody().string();

                OpenAiError error = mapper.readValue(errorBody, OpenAiError.class);
                throw new OpenAiHttpException(error, e, e.code());
            } catch (IOException ex) {
                // couldn't parse OpenAI error
                throw e;
            }
        }
    }
@Test
    void executeParseUnknownProperties() {
        // error body contains one unknown property and no message
        String errorBody = "{\"error\":{\"unknown\":\"Invalid auth token\",\"type\":\"type\",\"param\":\"param\",\"code\":\"code\"}}";
        HttpException httpException = createException(errorBody, 401);
        Single<CompletionResult> single = Single.error(httpException);

        OpenAiHttpException exception = assertThrows(OpenAiHttpException.class, () -> OpenAiService.execute(single));
        assertNull(exception.getMessage());
        assertEquals("type", exception.type);
        assertEquals("param", exception.param);
        assertEquals("code", exception.code);
        assertEquals(401, exception.statusCode);
    }