The best way to control Claude Code, Codex and more from any computer or phone
Inline sqlite error classification (#1515)
Julius Marminge committed
Mar 28, 2026 at 22:55 UTC
bc1024caf09aa349f18dd72aaf823588f3ff1fec
1 file changed
+12
-6
apps/server/src/persistence/NodeSqliteClient.ts
+12
-6
@@ -29,9 +29,6 @@ export const TypeId: TypeId = "~local/sqlite-node/SqliteClient";
29
30
export type TypeId = "~local/sqlite-node/SqliteClient";
31
32
-const classifyError = (cause: unknown, message: string, operation: string) =>
33
- classifySqliteError(cause, { message, operation });
34
-
32
/**
33
* SqliteClient - Effect service tag for the sqlite SQL client.
34
*/
@@ -114,7 +111,10 @@ const makeWithDatabase = (
111
try: () => db.prepare(sql),
112
catch: (cause) =>
113
new SqlError({
117
- reason: classifyError(cause, "Failed to prepare statement", "prepare"),
114
+ reason: classifySqliteError(cause, {
115
+ message: "Failed to prepare statement",
116
+ operation: "prepare",
117
+ }),
118
}),
119
}),
120
});
@@ -135,7 +135,10 @@ const makeWithDatabase = (
135
} catch (cause) {
136
return Effect.fail(
137
new SqlError({
138
- reason: classifyError(cause, "Failed to execute statement", "execute"),
138
+ reason: classifySqliteError(cause, {
139
+ message: "Failed to execute statement",
140
+ operation: "execute",
141
+ }),
142
}),
143
);
144
}
@@ -162,7 +165,10 @@ const makeWithDatabase = (
165
},
166
catch: (cause) =>
167
new SqlError({
165
- reason: classifyError(cause, "Failed to execute statement", "execute"),
168
+ reason: classifySqliteError(cause, {
169
+ message: "Failed to execute statement",
170
+ operation: "execute",
171
+ }),
172
}),
173
}),
174
(statement) =>