Skip to content

Commit d54fe04

Browse files
fix: simplify error message extraction logic in axios-logger by removing redundant comments
1 parent ec84f1d commit d54fe04

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/lib/axios-logger.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,10 @@ function extractErrorMessage(data: unknown, defaultMessage: string): string {
124124
}
125125

126126
// Fall back to default message for null/undefined or non-objects
127-
// Note: null is typeof "object" in JavaScript, so we check it explicitly
128127
if (data === null || data === undefined || typeof data !== "object") {
129128
return defaultMessage;
130129
}
131130

132-
// At this point, TypeScript knows data is a non-null object
133131
// error is in `data.error`
134132
if ("error" in data && data.error) {
135133
return String(data.error);

0 commit comments

Comments
 (0)