diff --git a/app/models/tx-store/tx-store.ts b/app/models/tx-store/tx-store.ts index 381a7b6f..e376951a 100644 --- a/app/models/tx-store/tx-store.ts +++ b/app/models/tx-store/tx-store.ts @@ -14,7 +14,7 @@ import { CosmosTxQueryResult, } from "../../services/cosmos" import { parseCosmosCoin } from "../../services/cosmos/cosmos.utils" -import { logError } from "../../utils/error" +import { logError, logMessage } from "../../utils/error" import { translateWithFallbackText } from "../../i18n" @@ -128,6 +128,7 @@ export const TxStoreModel = types let estimatedGas: number = yield message.simulate({ memo: self.memo }) if (estimatedGas === 0) { estimatedGas = 200000 + logMessage('[TxStore] Estimated gas is 0') } self.gas = new BigNumber(estimatedGas) } catch (error) { diff --git a/app/utils/error.ts b/app/utils/error.ts index 6a2a63ef..f5f3df6e 100644 --- a/app/utils/error.ts +++ b/app/utils/error.ts @@ -1,4 +1,4 @@ -import { sentryCaptureError } from './sentry' +import { sentryCaptureError, sentryCaptureMessage } from './sentry' export function logError(err: any) { if (__DEV__) { @@ -8,3 +8,12 @@ export function logError(err: any) { sentryCaptureError(err) } } + +export function logMessage(msg: string) { + if (__DEV__) { + console.tron.warn(msg) + } else { + console.warn(msg) + sentryCaptureMessage(msg) + } +} diff --git a/app/utils/sentry.ts b/app/utils/sentry.ts index 937feb54..bbba3793 100644 --- a/app/utils/sentry.ts +++ b/app/utils/sentry.ts @@ -9,6 +9,10 @@ export function initSentry(dsn: string, environment: string) { }) } +export function sentryCaptureMessage(msg: string) { + return Sentry.captureMessage(msg) +} + export function sentryCaptureError(err: unknown) { return Sentry.captureException(err) }