From ffef887ead205f9a3a9b82867a2b1618935779a4 Mon Sep 17 00:00:00 2001 From: aforaleka Date: Mon, 22 Apr 2024 11:49:16 -0400 Subject: [PATCH] fix type --- .../state/manager/V4StateManagerAdaptor.kt | 19 +++++++++++++------ .../v2/supervisor/SubaccountSupervisor.kt | 19 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt index 45e577b2d..fc7eafdda 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt @@ -1448,12 +1448,19 @@ class V4StateManagerAdaptor( ) } - private fun errorTrackingParams(error: ParsingError): IMap { - return iMapOf( - "errorType" to error.type.rawValue, - "errorMessage" to error.message, - "errorStringKey" to error.stringKey, - ) + private fun errorTrackingParams(error: ParsingError): IMap { + return if (error.stringKey != null) { + iMapOf( + "errorType" to error.type.rawValue, + "errorMessage" to error.message, + "errorStringKey" to error.stringKey, + ) + } else { + iMapOf( + "errorType" to error.type.rawValue, + "errorMessage" to error.message, + ) + } } override fun trackingParams(interval: Double): IMap { diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt index 5eb9e1d3d..7f611aa2d 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt @@ -370,12 +370,19 @@ internal class SubaccountSupervisor( ) } - private fun errorTrackingParams(error: ParsingError): IMap { - return iMapOf( - "errorType" to error.type.rawValue, - "errorMessage" to error.message, - "errorStringKey" to error.stringKey, - ) + private fun errorTrackingParams(error: ParsingError): IMap { + return if (error.stringKey != null) { + iMapOf( + "errorType" to error.type.rawValue, + "errorMessage" to error.message, + "errorStringKey" to error.stringKey, + ) + } else { + iMapOf( + "errorType" to error.type.rawValue, + "errorMessage" to error.message, + ) + } } fun closePosition(