```java
 public Result thenApplyWithContext(Function<Result, Result> fn) {
        this.thenApply(fn.compose(beforeContext).andThen(afterContext));
        // You may need to return a new Result instance representing the next async stage,
        // like thenApply will return a new CompletableFuture.
        return this;
    }
```

to

```java
```java
 public Result thenApplyWithContext(BiFunction<Throwable, Result> fn) {
        this.handle(fn);
        // You may need to return a new Result instance representing the next async stage,
        // like thenApply will return a new CompletableFuture.
        return this;
    }
```
```
private org.apache.dubbo.rpc.Result delegate;
        public CompatibleResult(org.apache.dubbo.rpc.Result result) {
            this.delegate = result;
        }
        public org.apache.dubbo.rpc.Result getDelegate() {
            return delegate;
        }
        @Override
        public Object getValue() {
            return delegate.getValue();
        }
        @Override
        public void setValue(Object value) {
            delegate.setValue(value);
        }
        @Override
        public Throwable getException() {
            return delegate.getException();
        }
        @Override
        public void setException(Throwable t) {
            delegate.setException(t);
        }
        @Override
        public boolean hasException() {
            return delegate.hasException();
        }
        @Override