0
我很困惑,爲什麼這個方法總是返回,即使發生了一個異常...不應該記錄錯誤後返回?從一個catch塊groovy返回
private def sendConfCode(sendTo)
{
def confCode = genConfCode()
try
{
mail.sendMessage(sendTo.toString(), "Your confirmation code is", confCode)
//insert confCode into temporary banner table?
}
catch(Exception e)
{
logIt.writeLog(e.message, Priority.ERR)
}
return confCode + " - " + sendTo
}
你怎麼知道會拋出異常?應用系統並查看異常是否被捕獲,如果是,那麼它是您的記錄器的錯誤 – Ankur
爲什麼*在異常被捕獲後不會返回?或者你的意思是它是特別*不*寫信息(並沖洗它等) –
我知道我得到一個例外。我想要執行停止在catch塊中。我覺得自己很愚蠢......重新調整了方法,並讓它做我想做的事情。 – innov83r