Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Partially return back to 1.1.62 API #154

Merged
merged 1 commit into from
Dec 3, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonElement

typealias GBTrackingCallback = (GBExperiment, GBExperimentResult?) -> Unit
typealias GBTrackingCallback = (GBExperiment, GBExperimentResult) -> Unit
typealias GBFeatureUsageCallback = (featureKey: String, gbFeatureResult: GBFeatureResult) -> Unit

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ internal class GBFeatureEvaluator {
result = track.result.experimentResult
)
) {
context.trackingCallback(track.experiment, track.result.experimentResult)
track.result.experimentResult?.let {
context.trackingCallback(track.experiment, it)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,12 @@ class GBError(error: Throwable?) {
/**
* Error Message for the caught error / exception
*/
private lateinit var errorMessage: String
val errorMessage: String = error?.message ?: ""

/**
* Error Stacktrace for the caught error / exception
*/
private lateinit var stackTrace: String

/**
* Constructor for initializing
*/
init {
if (error != null) {
errorMessage = error.message ?: ""
stackTrace = error.stackTraceToString()
}
}
val stackTrace: String? = error?.stackTraceToString()
}

/**
Expand Down Expand Up @@ -319,7 +309,7 @@ object RangeSerializer {
* Wrapper for deserialized model with optional field
*/
sealed class OptionalProperty<out T> {
object NotPresent : OptionalProperty<Nothing>()
data object NotPresent : OptionalProperty<Nothing>()
data class Present<T>(val value: T) : OptionalProperty<T>()
}

Expand Down
Loading