|
|
|
@ -21,6 +21,7 @@ package eu.faircode.email;
|
|
|
|
|
|
|
|
|
|
import android.text.TextUtils;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
|
|
|
|
public class ThrowableWrapper extends Throwable {
|
|
|
|
@ -36,12 +37,6 @@ public class ThrowableWrapper extends Throwable {
|
|
|
|
|
this.ex = ex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
@Override
|
|
|
|
|
public String getLocalizedMessage() {
|
|
|
|
|
return getSafeMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getSafeMessage() {
|
|
|
|
|
return (TextUtils.isEmpty(msg) ? super.getMessage() : msg);
|
|
|
|
|
}
|
|
|
|
@ -58,4 +53,34 @@ public class ThrowableWrapper extends Throwable {
|
|
|
|
|
public String toSafeString() {
|
|
|
|
|
return super.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
@Override
|
|
|
|
|
public String getMessage() {
|
|
|
|
|
return ex.getMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
@Override
|
|
|
|
|
public String getLocalizedMessage() {
|
|
|
|
|
return ex.getLocalizedMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
|
@Override
|
|
|
|
|
public StackTraceElement[] getStackTrace() {
|
|
|
|
|
return ex.getStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
@Override
|
|
|
|
|
public synchronized Throwable getCause() {
|
|
|
|
|
return ex.getCause();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
|
@Override
|
|
|
|
|
public String toString() {
|
|
|
|
|
return ex.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|