mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	fix: #1611 show corret message when can not query usage
This commit is contained in:
		@@ -189,10 +189,14 @@ export class ChatGPTApi implements LLMApi {
 | 
			
		||||
      }),
 | 
			
		||||
    ]);
 | 
			
		||||
 | 
			
		||||
    if (!used.ok || !subs.ok || used.status === 401) {
 | 
			
		||||
    if (used.status === 401) {
 | 
			
		||||
      throw new Error(Locale.Error.Unauthorized);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!used.ok || !subs.ok) {
 | 
			
		||||
      throw new Error("Failed to query usage from openai");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const response = (await used.json()) as {
 | 
			
		||||
      total_usage?: number;
 | 
			
		||||
      error?: {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user