Skip to content

Commit 5dd71cc

Browse files
committed
refactor: improve errors logs in api
1 parent b361384 commit 5dd71cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/src/rpc/router.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export function createRouter(params: {
6060
const durationMs = Date.now() - start;
6161
const meta = { "path": opts.path, "type": opts.type, durationMs };
6262

63-
result.ok ? console.log("OK request timing:", meta) : console.error("Non-OK request timing", meta);
63+
if (result.ok) {
64+
console.log("OK request timing:", meta);
65+
} else {
66+
console.error("Non-OK request timing", { meta, error: result.error });
67+
}
6468

6569
return result;
6670
})

0 commit comments

Comments
 (0)