Skip to content

Commit

Permalink
chore(store-indexer): stringify filter in error log (#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs authored Dec 9, 2023
1 parent 933b54b commit 5ab67e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silver-wasps-count.md
Original file line number Diff line number Diff line change
@@ -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]`.
6 changes: 5 additions & 1 deletion packages/store-indexer/src/postgres/apiRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5ab67e3

Please sign in to comment.