@AutoValue
public abstract class MyError extends Throwable {
public static MyError create(
Throwable ex,
MyErrorCode errorCode) {
return new AutoValue_MyError(ex, errorCode);
}
public abstract Throwable getError();
public abstract MyErrorCode myErrorCode();
}
我AutoValue
用来创建MyError
类,问题是如何super(ex.getCause())
传递实际上下文。看起来生成的实现没有这样做。