Skip to content

Commit

Permalink
API Erorr Handler: early exit if error can be silenced
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Feb 5, 2025
1 parent 5d9273d commit 0b3a84d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Utils/request/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import * as Notifications from "@/Utils/Notifications";
import { HTTPError, StructuredError } from "@/Utils/request/types";

export function handleHttpError(error: Error) {
if (error.name === "AbortError") {
// Skip handling silent errors and AbortError
if (("silent" in error && error.silent) || error.name === "AbortError") {
return;
}

Expand All @@ -15,10 +16,6 @@ export function handleHttpError(error: Error) {
return;
}

if (error.silent) {
return;
}

const cause = error.cause;

if (isNotFound(error)) {
Expand Down

0 comments on commit 0b3a84d

Please sign in to comment.