mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
fix: remove direct gaxios dependency (#4289)
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { GaxiosError } from 'gaxios';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { Config, CodeAssistServer, UserTierId } from '@google/gemini-cli-core';
|
||||
|
||||
@@ -113,13 +112,18 @@ async function getRemoteDataCollectionOptIn(
|
||||
try {
|
||||
const resp = await server.getCodeAssistGlobalUserSetting();
|
||||
return resp.freeTierDataCollectionOptin;
|
||||
} catch (e) {
|
||||
if (e instanceof GaxiosError) {
|
||||
if (e.response?.status === 404) {
|
||||
} catch (error: unknown) {
|
||||
if (error && typeof error === 'object' && 'response' in error) {
|
||||
const gaxiosError = error as {
|
||||
response?: {
|
||||
status?: unknown;
|
||||
};
|
||||
};
|
||||
if (gaxiosError.response?.status === 404) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
throw e;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user