Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.1/ktlint && chmod a+x ktlint
- run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.49.1/ktlint && chmod a+x ktlint
- run: ./ktlint
12 changes: 12 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_proto_library")
load("@rules_java//java:defs.bzl", "java_proto_library")
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test")
load("@rules_kotlin//kotlin:lint.bzl", "ktlint_fix", "ktlint_test")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//tools/project:build_defs.bzl", "project")

Expand Down Expand Up @@ -97,3 +98,14 @@ kt_jvm_test(
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core",
],
)

ktlint_fix(
name = "ktlint_fix",
srcs = glob(["**/*.kt"]),
)

ktlint_test(
name = "ktlint_test",
size = "small",
srcs = glob(["**/*.kt"]),
)
20 changes: 11 additions & 9 deletions lib/src/commonMain/kotlin/im/tox/tox4j/exceptions/ToxException.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package im.tox.tox4j.exceptions

abstract class ToxException constructor(val code: Enum<*>, private val extraMessage: String) :
Exception(extraMessage) {
final override val message: String
get() =
when (extraMessage) {
"" -> "Error code: " + code.name
else -> extraMessage + ", error code: " + code.name
}
}
abstract class ToxException(
val code: Enum<*>,
private val extraMessage: String,
) : Exception(extraMessage) {
final override val message: String
get() =
when (extraMessage) {
"" -> "Error code: " + code.name
else -> extraMessage + ", error code: " + code.name
}
}