mirror of https://github.com/M66B/FairEmail.git
Fixed stack trace
This commit is contained in:
parent
8b0cb299c3
commit
9ffe3c0688
|
@ -24,6 +24,10 @@ import android.text.TextUtils;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
// TODO CASA
|
||||
public class ThrowableWrapper extends Throwable {
|
||||
private String msg;
|
||||
|
@ -41,6 +45,10 @@ public class ThrowableWrapper extends Throwable {
|
|||
|
||||
ThrowableWrapper() {
|
||||
this.ex = new Throwable();
|
||||
List<StackTraceElement> stack = new ArrayList<>(Arrays.asList(ex.getStackTrace()));
|
||||
if (stack.size() > 0)
|
||||
stack.remove(0);
|
||||
ex.setStackTrace(stack.toArray(new StackTraceElement[0]));
|
||||
}
|
||||
|
||||
ThrowableWrapper(Throwable ex) {
|
||||
|
@ -86,6 +94,11 @@ public class ThrowableWrapper extends Throwable {
|
|||
return ex.getStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStackTrace(@NonNull StackTraceElement[] stackTrace) {
|
||||
ex.setStackTrace(stackTrace);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public synchronized Throwable getCause() {
|
||||
|
|
Loading…
Reference in New Issue