Skip to content

Commit ac82b65

Browse files
committed
feat: improve sql error logging so we can see the full stack trace from the server
1 parent 6097ce9 commit ac82b65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/execute-sql.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ const executeSql = async (req: {
4444
query,
4545
});
4646
} catch (error: unknown) {
47-
console.error(error);
48-
console.error("Error while executing sql", { error });
47+
console.error("Error while executing sql:", error);
48+
if (error instanceof Error && "context" in error) {
49+
const ctx = (error as Error & { context?: { debug?: unknown } }).context;
50+
console.error(
51+
"Error context.debug:",
52+
JSON.stringify(ctx?.debug, null, 2),
53+
);
54+
}
4955

5056
const errorMessage = error instanceof Error ? error.message : String(error);
5157

0 commit comments

Comments
 (0)