NTP-39209 | Narayan | Qr code image generation failure logging (#15074)
This commit is contained in:
committed by
GitHub
parent
395a9f2a31
commit
4fbf13dd86
@@ -93,6 +93,13 @@ class NaviPayAnalytics private constructor() {
|
||||
mapOf("height" to height.toString(), "width" to width.toString()),
|
||||
)
|
||||
}
|
||||
|
||||
fun onQrCodeImageGenerationFailure(exception: Exception) {
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
"NaviPay_QrCode_Image_Generation_Failure",
|
||||
mapOf("exception" to exception.toString()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
inner class SetupUseCaseEvents {
|
||||
|
||||
@@ -721,7 +721,10 @@ fun createQrCode(qrCodeData: String, context: Context): Bitmap? {
|
||||
|
||||
qrCodeCanvas.drawBitmap(logoBitmap, xLogo, yLogo, null)
|
||||
return qrCodeDataBitmap
|
||||
} catch (_: Exception) {
|
||||
} catch (exception: Exception) {
|
||||
val naviPayAnalytics: NaviPayAnalytics.UtilityEvents =
|
||||
NaviPayAnalytics.INSTANCE.UtilityEvents()
|
||||
naviPayAnalytics.onQrCodeImageGenerationFailure(exception = exception)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024 by Navi Technologies Limited
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -11,6 +11,7 @@ import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.net.Uri
|
||||
import androidx.core.content.FileProvider
|
||||
import com.navi.pay.analytics.NaviPayAnalytics
|
||||
import com.navi.pay.utils.QR_CODE_IMAGE_EXTENSION
|
||||
import com.navi.pay.utils.VPA_QR_CODE_IMAGES
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
@@ -26,6 +27,9 @@ interface VpaQRCodeManager {
|
||||
class VpaQRCodeManagerImpl @Inject constructor(@ApplicationContext private val context: Context) :
|
||||
VpaQRCodeManager {
|
||||
|
||||
private val naviPayAnalytics: NaviPayAnalytics.UtilityEvents =
|
||||
NaviPayAnalytics.INSTANCE.UtilityEvents()
|
||||
|
||||
override fun getVpaUri(vpa: String, upiUri: String): Uri? {
|
||||
val imagesFolder = File(context.cacheDir, VPA_QR_CODE_IMAGES)
|
||||
var uri: Uri? = null
|
||||
@@ -44,7 +48,9 @@ class VpaQRCodeManagerImpl @Inject constructor(@ApplicationContext private val c
|
||||
uri = getUriOfFile(file)
|
||||
}
|
||||
}
|
||||
} catch (_: IOException) {}
|
||||
} catch (exception: IOException) {
|
||||
naviPayAnalytics.onQrCodeImageGenerationFailure(exception = exception)
|
||||
}
|
||||
return uri
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user