package com.auparty.android.crashguard

import android.util.Log

/**
 * @author SimonHou
 * @description:
 * @date :2023/4/28 17:55
 */
abstract class ExceptionHandler {

    fun uncaughtException(thread: Thread, throwable: Throwable){
        try {
            Log.e("simon","666666"+thread.name)
            onUncaughtException(thread, throwable)
        }catch (e:Throwable){
            e.printStackTrace()
        }
    }

    fun unCatchLifeCycleException(thread: Thread, throwable: Throwable){
        try {
            onLifeCycleException(thread,throwable)
        }catch (e:Throwable){
            e.printStackTrace()
        }
    }

    protected abstract fun onUncaughtException(thread: Thread, throwable: Throwable)

    protected abstract fun onLifeCycleException(thread: Thread,e:Throwable)

}