From 5ab67e3350bd08d15fbbe28c498cec62d2aaa116 Mon Sep 17 00:00:00 2001 From: alvarius Date: Sat, 9 Dec 2023 13:16:21 +0100 Subject: [PATCH] chore(store-indexer): stringify filter in error log (#2048) --- .changeset/silver-wasps-count.md | 5 +++++ packages/store-indexer/src/postgres/apiRoutes.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/silver-wasps-count.md diff --git a/.changeset/silver-wasps-count.md b/.changeset/silver-wasps-count.md new file mode 100644 index 0000000000..2fdac237e4 --- /dev/null +++ b/.changeset/silver-wasps-count.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/store-indexer": patch +--- + +The error log if no data is found in `/api/logs` is now stringifying the filter instead of logging `[object Object]`. diff --git a/packages/store-indexer/src/postgres/apiRoutes.ts b/packages/store-indexer/src/postgres/apiRoutes.ts index 92ca7e0b3d..8f71014cbc 100644 --- a/packages/store-indexer/src/postgres/apiRoutes.ts +++ b/packages/store-indexer/src/postgres/apiRoutes.ts @@ -36,7 +36,11 @@ export function apiRoutes(database: Sql): Middleware { if (records.length === 0) { ctx.status = 404; ctx.body = "no logs found"; - error(`no logs found for chainId ${options.chainId}, address ${options.address}, filters ${options.filters}`); + error( + `no logs found for chainId ${options.chainId}, address ${options.address}, filters ${JSON.stringify( + options.filters + )}` + ); return; }