Skip to content

Commit

Permalink
feat: handle invalid listener id with status error 400 instead of 404
Browse files Browse the repository at this point in the history
  • Loading branch information
gpuente committed Jul 8, 2024
1 parent e4e72de commit febbe2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hooks/useClientErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useClientErrorHandler = (): ClientErrorHandler => {

const pullResponderRegisterDelay = useRef<Map<string, number>>(new Map());

const handleStrands404 = useCallback(
const handleStrands400 = useCallback(
async (driveId: string, trigger: Trigger, handlerCode: string) => {
setHandlingInProgress(state => [...state, handlerCode]);

Expand Down Expand Up @@ -86,7 +86,7 @@ export const useClientErrorHandler = (): ClientErrorHandler => {
const strandsErrorHandler: ClientErrorHandler['strandsErrorHandler'] =
async (driveId, trigger, status) => {
switch (status) {
case 404: {
case 400: {
const handlerCode = `strands:${driveId}:${status}`;

if (handlingInProgress.includes(handlerCode)) return;
Expand All @@ -97,7 +97,7 @@ export const useClientErrorHandler = (): ClientErrorHandler => {
0;

setTimeout(
() => handleStrands404(driveId, trigger, handlerCode),
() => handleStrands400(driveId, trigger, handlerCode),
delay,
);

Expand Down

0 comments on commit febbe2d

Please sign in to comment.