Skip to content

Commit c9d7560

Browse files
authoredJun 29, 2022
Merge pull request #72 from martinbonnin/more-details-on-error
If a statement fails to compile, log more information to the caller
2 parents 6794430 + 08cec9a commit c9d7560

File tree

1 file changed

+3
-1
lines changed
  • sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/interop

1 file changed

+3
-1
lines changed
 

‎sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/interop/SqliteDatabase.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ internal class SqliteDatabase(path: String, label: String, val logger: Logger, p
1919
)
2020

2121
if (err != SQLITE_OK) {
22-
throw sqlException(logger, config, "error while compiling: $sqlString", err)
22+
val error = sqlite3_errmsg(dbPointer)?.toKString()
23+
24+
throw sqlException(logger, config, "error while compiling: $sqlString\n$error", err)
2325
}
2426

2527
statementPtr.value!!

0 commit comments

Comments
 (0)
Please sign in to comment.