refactor: renomear package me.capcom.smsgateway → pt.whatsms.gateway
Build AAB — WhatSMS Gateway / build (push) Failing after 34s
Build AAB — WhatSMS Gateway / build (push) Failing after 34s
- namespace, applicationId, todos os ficheiros .kt/.xml/.gradle actualizados - directório me/capcom/smsgateway/ → pt/whatsms/gateway/ - zero referências a capcom no código fonte
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package pt.whatsms.gateway
|
||||
|
||||
import android.util.Log
|
||||
import pt.whatsms.gateway.modules.logs.LogsService
|
||||
import pt.whatsms.gateway.modules.logs.db.LogEntry
|
||||
import org.koin.core.component.KoinComponent
|
||||
import java.lang.Thread.UncaughtExceptionHandler
|
||||
|
||||
class GlobalExceptionHandler(
|
||||
private val defaultHandler: UncaughtExceptionHandler,
|
||||
private val logger: LogsService
|
||||
) : UncaughtExceptionHandler, KoinComponent {
|
||||
|
||||
override fun uncaughtException(thread: Thread, throwable: Throwable) {
|
||||
try {
|
||||
logger.insert(
|
||||
LogEntry.Priority.ERROR,
|
||||
"GlobalExceptionHandler",
|
||||
"Unhandled exception in ${thread.name}",
|
||||
mapOf(
|
||||
"message" to throwable.message,
|
||||
"stackTrace" to throwable.stackTrace.joinToString("\n"),
|
||||
"threadName" to thread.name,
|
||||
)
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
Log.e("GlobalExceptionHandler", "Failed to log uncaught exception", e)
|
||||
} finally {
|
||||
defaultHandler.uncaughtException(thread, throwable)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user