Skip to content

Commit

Permalink
Merge branch 'hm/linux-build-publish' of https://github.com/hbmartin/…
Browse files Browse the repository at this point in the history
…SQLiter into hbmartin-hm/linux-build-publish
  • Loading branch information
kpgalligan committed Nov 6, 2023
2 parents 46b04d1 + 152f32f commit 93f2486
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ jobs:
build:
strategy:
matrix:
os: [ macOS-latest ]
# os: [ macOS-latest, ubuntu-18.04 ] GitHub actions removed ubuntu-18.04
# os: [ macOS-latest, windows-latest, ubuntu-18.04 ]
os: [ macOS-latest, windows-latest, ubuntu-22.04 ]
runs-on: ${{matrix.os}}
steps:
- name: Checkout the repo
uses: actions/checkout@v2

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11

- name: Install msys2
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
Expand Down
2 changes: 0 additions & 2 deletions sqliter-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ fun configInterop(target: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTar

kotlin {
jvmToolchain(11)
}

kotlin {
val knTargets = listOf(
macosX64(),
iosX64(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package co.touchlab.sqliter.interop

open class SQLiteException internal constructor(message: String, private val config: SqliteDatabaseConfig) : Exception(message)
open class SQLiteException internal constructor(message: String, internal val config: SqliteDatabaseConfig) : Exception(message)

class SQLiteExceptionErrorCode internal constructor(message: String, config: SqliteDatabaseConfig, private val errorCode: Int) : SQLiteException(message, config) {
val errorType: SqliteErrorType by lazy {
val checkErrorCode = errorCode and 0xff
SqliteErrorType.values().find { it.code == checkErrorCode }
?: throw IllegalArgumentException("Unknown errorCode $errorCode, checkErrorCode $checkErrorCode")
}
override fun toString(): String {
return "SQLiteExceptionErrorCode(message=$message, errorCode=$errorCode, config=$config)"
}
}

internal inline fun sqlException(logging: Logger, config: SqliteDatabaseConfig, message: String, errorCode: Int = -1): SQLiteException {
Expand Down

0 comments on commit 93f2486

Please sign in to comment.