| ... | ... | @@ -29,9 +29,6 @@ export const TypeId: TypeId = "~local/sqlite-node/SqliteClient"; |
| 29 | 29 | |
| 30 | 30 | export type TypeId = "~local/sqlite-node/SqliteClient"; |
| 31 | 31 | |
| 32 | | const classifyError = (cause: unknown, message: string, operation: string) => |
| 33 | | classifySqliteError(cause, { message, operation }); |
| 34 | | |
| 35 | 32 | /** |
| 36 | 33 | * SqliteClient - Effect service tag for the sqlite SQL client. |
| 37 | 34 | */ |
| ... | ... | @@ -114,7 +111,10 @@ const makeWithDatabase = ( |
| 114 | 111 | try: () => db.prepare(sql), |
| 115 | 112 | catch: (cause) => |
| 116 | 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 | 118 | }), |
| 119 | 119 | }), |
| 120 | 120 | }); |
| ... | ... | @@ -135,7 +135,10 @@ const makeWithDatabase = ( |
| 135 | 135 | } catch (cause) { |
| 136 | 136 | return Effect.fail( |
| 137 | 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 | }), |
| 139 | 142 | }), |
| 140 | 143 | ); |
| 141 | 144 | } |
| ... | ... | @@ -162,7 +165,10 @@ const makeWithDatabase = ( |
| 162 | 165 | }, |
| 163 | 166 | catch: (cause) => |
| 164 | 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 | }), |
| 166 | 172 | }), |
| 167 | 173 | }), |
| 168 | 174 | (statement) => |