mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
fix: remove direct gaxios dependency (#4289)
This commit is contained in:
parent
695afac33e
commit
4b8838bea4
5 changed files with 18 additions and 118 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue