Atul Gupta
06/01/2023, 2:26 PMTooGenericExceptionCaught
is not catching a below code
fun test() {
var body = ""
var title = ""
var canShowValidNotification = true
val json = JSONObject(nestedBody)
try
{
body = json.getString("body")
title = json.getString("title")
}
catch (exception: Exception)
{
// malformed do not show notification
canShowValidNotification = false
val payload = exception.message ?: "empty or null"
val errorMessage = "Push notification has Invalid Payload"
}
}
while when I add this in the TooGenericExceptionCaughtSpec
as test it is successfully passing.
I want to publish the detekt
in my local maven with logs and then analyse the issueBrais Gabin
06/01/2023, 10:09 PMBrais Gabin
06/01/2023, 10:09 PM