@Override
    public void onException(Throwable e) {
        if (callback == null) {
            return;
        }
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(this.classLoader);
            RpcInternalContext.setContext(context);

            if (EventBus.isEnable(ClientAsyncReceiveEvent.class)) {
                EventBus.post(new ClientAsyncReceiveEvent(consumerConfig, providerInfo,
                    request, null, e));
            }

            // do async filter after respond server
            FilterChain chain = consumerConfig.getConsumerBootstrap().getCluster().getFilterChain();
            if (chain != null) {
                chain.onAsyncResponse(consumerConfig, request, null, e);
            }

            recordClientElapseTime();
            if (EventBus.isEnable(ClientEndInvokeEvent.class)) {
                EventBus.post(new ClientEndInvokeEvent(request, null, e));
            }

            //judge is timeout or others
            SofaRpcException sofaRpcException = null;
            if (e instanceof InvokeTimeoutException) {
                sofaRpcException = new SofaTimeOutException(e);
            } else {
                sofaRpcException = new SofaRpcException(
                    RpcErrorType.SERVER_UNDECLARED_ERROR, e.getMessage(), e);
            }
            callback.onSofaException(sofaRpcException, request.getMethodName(), request);
        } finally {
            Thread.currentThread().setContextClassLoader(cl);
            RpcInvokeContext.removeContext();
            RpcInternalContext.removeAllContext();
        }
    }
Instantiates a new Bolt invoker callback.

@param consumerConfig the consumer config
@param providerInfo   the provider info
@param listener       the listener
@param request        the request
@param context        the context
@param classLoader    the class loader
remoting/remoting-bolt/src/main/java/com/alipay/sofa/rpc/message/bolt/BoltInvokerCallback.java