@@ -20,7 +20,7 @@ import * as Stream from "effect/Stream";
2020import * as Reactivity from "effect/unstable/reactivity/Reactivity" ;
2121import * as Client from "effect/unstable/sql/SqlClient" ;
2222import type { Connection } from "effect/unstable/sql/SqlConnection" ;
23- import { SqlError , classifySqliteError } from "effect/unstable/sql/SqlError" ;
23+ import { SqlError } from "effect/unstable/sql/SqlError" ;
2424import * as Statement from "effect/unstable/sql/Statement" ;
2525
2626const ATTR_DB_SYSTEM_NAME = "db.system.name" ;
@@ -29,9 +29,6 @@ export const TypeId: TypeId = "~local/sqlite-node/SqliteClient";
2929
3030export type TypeId = "~local/sqlite-node/SqliteClient" ;
3131
32- const classifyError = ( cause : unknown , message : string , operation : string ) =>
33- classifySqliteError ( cause , { message, operation } ) ;
34-
3532/**
3633 * SqliteClient - Effect service tag for the sqlite SQL client.
3734 */
@@ -112,10 +109,7 @@ const makeWithDatabase = (
112109 lookup : ( sql : string ) =>
113110 Effect . try ( {
114111 try : ( ) => db . prepare ( sql ) ,
115- catch : ( cause ) =>
116- new SqlError ( {
117- reason : classifyError ( cause , "Failed to prepare statement" , "prepare" ) ,
118- } ) ,
112+ catch : ( cause ) => new SqlError ( { cause, message : "Failed to prepare statement" } ) ,
119113 } ) ,
120114 } ) ;
121115
@@ -133,11 +127,7 @@ const makeWithDatabase = (
133127 const result = statement . run ( ...( params as any ) ) ;
134128 return Effect . succeed ( raw ? ( result as unknown as ReadonlyArray < any > ) : [ ] ) ;
135129 } catch ( cause ) {
136- return Effect . fail (
137- new SqlError ( {
138- reason : classifyError ( cause , "Failed to execute statement" , "execute" ) ,
139- } ) ,
140- ) ;
130+ return Effect . fail ( new SqlError ( { cause, message : "Failed to execute statement" } ) ) ;
141131 }
142132 } ) ;
143133
@@ -160,10 +150,7 @@ const makeWithDatabase = (
160150 statement . run ( ...( params as any ) ) ;
161151 return [ ] ;
162152 } ,
163- catch : ( cause ) =>
164- new SqlError ( {
165- reason : classifyError ( cause , "Failed to execute statement" , "execute" ) ,
166- } ) ,
153+ catch : ( cause ) => new SqlError ( { cause, message : "Failed to execute statement" } ) ,
167154 } ) ,
168155 ( statement ) =>
169156 Effect . sync ( ( ) => {
0 commit comments