Runt
2025-05-18 ff59eb9415d3df520df98e14ef66d9a3d9804c5b
libmvi/src/main/java/com/runt/open/mvi/CrashHandler.java
@@ -87,7 +87,7 @@
     */
    @Override
    public void uncaughtException(Thread thread, Throwable ex) {
        Log.i(TAG, "uncaughtException Throwable:"+ex);
        //Log.i(TAG, "uncaughtException Throwable:"+ex);
        if (!handleException(ex) && mDefaultHandler != null) {
            //如果用户没有处理则让系统默认的异常处理器来处理
            mDefaultHandler.uncaughtException(thread, ex);
@@ -104,7 +104,7 @@
     * @return true:如果处理了该异常信息;否则返回false.
     */
    private boolean handleException(Throwable ex) {
        Log.i(TAG, "handleException Throwable:"+ex);
        //Log.i(TAG, "handleException Throwable:"+ex);
        if (ex == null) {
            return false;
        }
@@ -154,7 +154,7 @@
     */
    private String saveCatchInfoFile(Throwable ex) {
        ex.printStackTrace();
        Log.i(TAG, "saveCatchInfo2File Throwable:"+ex);
        //Log.i(TAG, "saveCatchInfo2File Throwable:"+ex);
        StringBuffer sb = new StringBuffer();
        for (Map.Entry<String, String> entry : infos.entrySet()) {
@@ -165,10 +165,10 @@
        Writer writer = new StringWriter();
        PrintWriter printWriter = new PrintWriter(writer);
        ex.printStackTrace(printWriter);
        //ex.printStackTrace(printWriter);
        Throwable cause = ex.getCause();
        while (cause != null) {
            cause.printStackTrace(printWriter);
            //cause.printStackTrace(printWriter);
            cause = cause.getCause();
        }
        printWriter.close();
@@ -226,7 +226,7 @@
                s = reader.readLine();
                if(s == null) break;
                //由于目前尚未确定以何种方式发送,所以先打出log日志。
                Log.i("info", s.toString());
                //Log.i("info", s.toString());
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();