fix(log): pass throwable to Log.w in Marmot catch blocks
Previously the catch-block warnings interpolated ${e.message} but
dropped the throwable, losing the stack trace and showing nothing for
exceptions whose message is null. Switch to the (tag, msg, throwable)
overload so the cause and stack trace are logged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
-6
@@ -370,17 +370,17 @@ class MarmotManager(
|
||||
try {
|
||||
groupManager.clearAllState()
|
||||
} catch (e: Exception) {
|
||||
Log.w("MarmotManager") { "resetAllState(): groupManager.clearAllState failed: ${e.message}" }
|
||||
Log.w("MarmotManager", "resetAllState(): groupManager.clearAllState failed", e)
|
||||
}
|
||||
try {
|
||||
keyPackageRotationManager.clearAllState()
|
||||
} catch (e: Exception) {
|
||||
Log.w("MarmotManager") { "resetAllState(): keyPackageRotationManager.clearAllState failed: ${e.message}" }
|
||||
Log.w("MarmotManager", "resetAllState(): keyPackageRotationManager.clearAllState failed", e)
|
||||
}
|
||||
try {
|
||||
subscriptionManager.clear()
|
||||
} catch (e: Exception) {
|
||||
Log.w("MarmotManager") { "resetAllState(): subscriptionManager.clear failed: ${e.message}" }
|
||||
Log.w("MarmotManager", "resetAllState(): subscriptionManager.clear failed", e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ class MarmotManager(
|
||||
try {
|
||||
messageStore?.delete(nostrGroupId)
|
||||
} catch (e: Exception) {
|
||||
Log.w("MarmotManager") { "Failed to delete persisted messages for $nostrGroupId: ${e.message}" }
|
||||
Log.w("MarmotManager", "Failed to delete persisted messages for $nostrGroupId", e)
|
||||
}
|
||||
return outboundEvent
|
||||
}
|
||||
@@ -423,7 +423,7 @@ class MarmotManager(
|
||||
try {
|
||||
messageStore?.appendMessage(nostrGroupId, innerEventJson)
|
||||
} catch (e: Exception) {
|
||||
Log.w("MarmotManager") { "Failed to persist Marmot message for $nostrGroupId: ${e.message}" }
|
||||
Log.w("MarmotManager", "Failed to persist Marmot message for $nostrGroupId", e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ class MarmotManager(
|
||||
try {
|
||||
messageStore?.loadMessages(nostrGroupId) ?: emptyList()
|
||||
} catch (e: Exception) {
|
||||
Log.w("MarmotManager") { "Failed to load persisted messages for $nostrGroupId: ${e.message}" }
|
||||
Log.w("MarmotManager", "Failed to load persisted messages for $nostrGroupId", e)
|
||||
emptyList()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user