修复 子线程出错时没有打印详细信息的问题

This commit is contained in:
hyb1996 2018-10-18 00:16:57 +08:00
parent 3d6c2812c6
commit fbe2df406a
2 changed files with 7 additions and 3 deletions

View File

@ -281,12 +281,13 @@ public class StardustConsole extends AbstractConsole {
data = getStackTrace((Throwable) data);
}
if (options != null && options.length > 0) {
for (int i = 0; i < options.length; i++) {
Object option = options[i];
StringBuilder sb = new StringBuilder(data == null ? "" : data.toString());
for (Object option : options) {
if (option instanceof Throwable) {
options[i] = getStackTrace((Throwable) option);
sb.append(getStackTrace((Throwable) option)).append(" ");
}
}
data = sb.toString();
}
super.error(data, options);
}

View File

@ -5,6 +5,8 @@ import android.util.Log;
import com.stardust.autojs.runtime.exception.ScriptException;
import java.util.Formatter;
/**
* Created by Stardust on 2017/5/1.
*/
@ -63,4 +65,5 @@ public abstract class AbstractConsole implements Console {
}
}
}