Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: minor error handler message

sawhileb9385840f67
diff --git a/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx b/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx
index 85b8d2d476..71be4ee326 100644
--- a/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx
+++ b/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx
@@ -10,7 +10,6 @@ import { useGetCompositeQueryParam } from 'hooks/queryBuilder/useGetCompositeQue
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import useDebouncedFn from 'hooks/useDebouncedFunction';
import { useEventSourceEvent } from 'hooks/useEventSourceEvent';
-import { useNotifications } from 'hooks/useNotifications';
import { prepareQueryRangePayload } from 'lib/dashboard/prepareQueryRangePayload';
import { useEventSource } from 'providers/EventSource';
import { useCallback, useEffect, useRef, useState } from 'react';
@@ -38,8 +37,6 @@ function LiveLogsContainer(): JSX.Element {
const batchedEventsRef = useRef<ILog[]>([]);
- const { notifications } = useNotifications();
-
const { selectedTime: globalSelectedTime } = useSelector<
AppState,
GlobalReducer
@@ -88,8 +85,8 @@ function LiveLogsContainer(): JSX.Element {
);
const handleError = useCallback(() => {
- notifications.error({ message: 'Sorry, something went wrong' });
- }, [notifications]);
+ console.error('Sorry, something went wrong');
+ }, []);
useEventSourceEvent('message', handleGetLiveLogs);
useEventSourceEvent('error', handleError);
@@ -157,7 +154,6 @@ function LiveLogsContainer(): JSX.Element {
useEffect((): (() => void) | undefined => {
if (isConnectionError && reconnectDueToError && compositeQuery) {
- console.log('uncaught refetch try from component', reconnectDueToError);
// Small delay to prevent immediate reconnection attempts
const reconnectTimer = setTimeout(() => {
handleStartNewConnection(compositeQuery);
diff --git a/frontend/src/providers/EventSource.tsx b/frontend/src/providers/EventSource.tsx
index e75226a424..fa8f1fd223 100644
--- a/frontend/src/providers/EventSource.tsx
+++ b/frontend/src/providers/EventSource.tsx
@@ -7,6 +7,7 @@ import { ENVIRONMENT } from 'constants/env';
import { LIVE_TAIL_HEARTBEAT_TIMEOUT } from 'constants/liveTail';
import { LOCALSTORAGE } from 'constants/localStorage';
import { EventListener, EventSourcePolyfill } from 'event-source-polyfill';
+import { useNotifications } from 'hooks/useNotifications';
import {
createContext,
PropsWithChildren,
@@ -58,6 +59,8 @@ export function EventSourceProvider({
const eventSourceRef = useRef<EventSourcePolyfill | null>(null);
+ const { notifications } = useNotifications();
+
const handleSetInitialLoading = useCallback((value: boolean) => {
setInitialLoading(value);
}, []);
@@ -78,8 +81,6 @@ export function EventSourceProvider({
refreshToken: getLocalStorageApi(LOCALSTORAGE.REFRESH_AUTH_TOKEN) || '',
});
- console.log('uncaught token refresh started', { response });
-
if (response.statusCode === 200) {
// Update tokens in local storage
afterLogin(
@@ -96,8 +97,8 @@ export function EventSourceProvider({
return;
}
+ notifications.error({ message: 'Sorry, something went wrong' });
// If token refresh failed, logout the user
-
if (!eventSourceRef.current) return;
eventSourceRef.current.close();
setIsConnectionError(true);
@@ -105,13 +106,14 @@ export function EventSourceProvider({
} catch (error) {
// If there was an error during token refresh, we'll just
// let the component handle the error state
+ notifications.error({ message: 'Sorry, something went wrong' });
console.error('Error refreshing token:', error);
setIsConnectionError(true);
if (!eventSourceRef.current) return;
eventSourceRef.current.close();
Logout();
}
- }, []);
+ }, [notifications]);
const destroyEventSourceSession = useCallback(() => {
if (!eventSourceRef.current) return;