Skip to content

Commit

Permalink
Merge pull request #72 from martinbonnin/more-details-on-error
Browse files Browse the repository at this point in the history
If a statement fails to compile, log more information to the caller
  • Loading branch information
kpgalligan authored Jun 29, 2022
2 parents 6794430 + 08cec9a commit c9d7560
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ internal class SqliteDatabase(path: String, label: String, val logger: Logger, p
)

if (err != SQLITE_OK) {
throw sqlException(logger, config, "error while compiling: $sqlString", err)
val error = sqlite3_errmsg(dbPointer)?.toKString()

throw sqlException(logger, config, "error while compiling: $sqlString\n$error", err)
}

statementPtr.value!!
Expand Down

0 comments on commit c9d7560

Please sign in to comment.