Skip to content

Commit 3268870

Browse files
committed
Update logging meggeges.
1 parent 6931ee8 commit 3268870

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/utils/dataLoader.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ export async function loadData(
2929
throw new Error(`Received empty or invalid JSON`);
3030
}
3131

32+
if (Array.isArray(data)) {
33+
console.log(`Received JSON array with ${data.length} items`);
34+
} else if (typeof data === "object") {
35+
console.log(
36+
`Received JSON object with ${Object.keys(data).length} keys`
37+
);
38+
} else {
39+
console.log(`Received JSON of type: ${typeof data}`);
40+
}
41+
3242
return data;
3343
} catch (error) {
3444
console.error(`Attempt ${attempt} failed:`, error);
@@ -42,6 +52,4 @@ export async function loadData(
4252
}
4353
}
4454
}
45-
46-
throw new Error(`Unexpected execution path`);
4755
}

0 commit comments

Comments
 (0)