Skip to content

Commit 8c3c84e

Browse files
committed
fix: console.error in hooks
1 parent 759c857 commit 8c3c84e

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/client/src/hooks/use-agent-management.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useState } from 'react';
44
import { useNavigate } from 'react-router-dom';
55
import { useStartAgent, useStopAgent } from './use-query-hooks';
66
import { useToast } from './use-toast';
7-
// Direct error handling
7+
import clientLogger from '@/lib/logger';
88

99
/**
1010
* Custom hook for managing agents (starting, stopping, and tracking status)
@@ -55,7 +55,7 @@ export function useAgentManagement() {
5555
// Start the agent
5656
await startAgentMutation.mutateAsync(agentId);
5757
} catch (error) {
58-
console.error('Failed to start agent:', error);
58+
clientLogger.error('Failed to start agent:', error);
5959
// Let the mutation's onError handler show the appropriate toast
6060
} finally {
6161
// Remove agent from starting list regardless of success/failure
@@ -95,7 +95,7 @@ export function useAgentManagement() {
9595
description: `${agent.name} has been stopped`,
9696
});
9797
} catch (error) {
98-
console.error('Failed to stop agent:', error);
98+
clientLogger.error('Failed to stop agent:', error);
9999
// Let the mutation's onError handler show the appropriate toast
100100
} finally {
101101
// Remove agent from stopping list regardless of success/failure

packages/client/src/hooks/use-elevenlabs-voices.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
22
import { useQuery } from '@tanstack/react-query';
33
import { elevenLabsVoiceModels } from '@/config/voice-models';
44
import type { VoiceModel } from '@/config/voice-models';
5+
import clientLogger from '@/lib/logger';
56

67
// TODO: Move this to a shared config file, or the 11labs plugin once plugin categories are implemented
78

@@ -45,7 +46,7 @@ export function useElevenLabsVoices() {
4546
});
4647

4748
if (!response.ok) {
48-
console.error('Failed to fetch ElevenLabs voices:', response.statusText);
49+
clientLogger.error('Failed to fetch ElevenLabs voices:', response.statusText);
4950
return [];
5051
}
5152

@@ -71,7 +72,7 @@ export function useElevenLabsVoices() {
7172

7273
return apiVoices;
7374
} catch (error) {
74-
console.error('Error fetching ElevenLabs voices:', error);
75+
clientLogger.error('Error fetching ElevenLabs voices:', error);
7576
return [];
7677
}
7778
},

packages/client/src/hooks/use-query-hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ export function useChannelParticipants(channelId: UUID | undefined, options = {}
11991199
}
12001200
return { success: true, data: participants };
12011201
} catch (error) {
1202-
console.error('[useChannelParticipants] Error:', error);
1202+
clientLogger.error('[useChannelParticipants] Error:', error);
12031203
return { success: false, data: [] };
12041204
}
12051205
},

0 commit comments

Comments
 (0)