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
6 changes: 5 additions & 1 deletion src/main/kotlin/com/featurevisor/sdk/Conditions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ object Conditions {
}

private fun compareVersions(actual: String, condition: String): Int {
return SemVer.parse(actual).compareTo(SemVer.parse(condition))
return try {
SemVer.parse(actual).compareTo(SemVer.parse(condition))
} catch (e: Exception) {
0
}
}
}
6 changes: 2 additions & 4 deletions src/main/kotlin/com/featurevisor/sdk/Instance+Evaluation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ fun FeaturevisorInstance.evaluateVariation(featureKey: FeatureKey, context: Cont
evaluation = Evaluation(
featureKey = featureKey,
reason = ERROR,
error(e)
)

this.logger?.error("error", evaluation.toDictionary())
this.logger?.error(message = e.message.orEmpty(), details = evaluation.toDictionary())

return evaluation
}
Expand Down Expand Up @@ -433,10 +432,9 @@ fun FeaturevisorInstance.evaluateFlag(featureKey: FeatureKey, context: Context =
evaluation = Evaluation(
featureKey = featureKey,
reason = ERROR,
error(e)
)

this.logger?.error("error", evaluation.toDictionary())
this.logger?.error(message = e.message.orEmpty(), details = evaluation.toDictionary())

return evaluation
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun startTest(option: TestProjectOption) {
try {
executionResult = executeTest(filePath, dataFile = datafile, option)
} catch (e: Exception) {
printMessageInRedColor("Exception in $filePath --> ${e.message}")
printMessageInRedColor("Exception while execution test --> ${e.message}")
}

if (executionResult == null) {
Expand Down