@Test
    public void testResponseSerialThrowable() throws Exception {
        NormalRequestBodyCustomSerializer s1 = new NormalRequestBodyCustomSerializer();
        AtomicBoolean serialFlag = new AtomicBoolean();
        DefaultCustomSerializer s2 = new DefaultCustomSerializer() {

            @Override
            public <T extends ResponseCommand> boolean serializeContent(T response) throws SerializationException {
                serialFlag.set(true);
                throw new StackOverflowError("testResponseSerialThrowable");
            }

        };
        CustomSerializerManager.registerCustomSerializer(RequestBody.class.getName(), s1);
        CustomSerializerManager.registerCustomSerializer(String.class.getName(), s2);

        RequestBody body = new RequestBody(1, "hello world!");
        String ret = null;
        try {
            ret = (String) client.invokeSync(addr, body, 1000_00000);
            Assert.fail("Should not reach here!");
        } catch (InvokeServerException e) {
            logger.error("", e);
            Assert.assertEquals(null, ret);
            Assert.assertNotNull(e.getCause());
            Assert.assertTrue(e.getCause() instanceof RpcServerException);
            Assert.assertTrue(s1.isSerialized());
            Assert.assertTrue(s1.isDeserialized());
            Assert.assertTrue(serialFlag.get());
        } catch (Throwable t) {
            Assert.fail("Should not reach here!");
        }
    }
test Throwable when serial response

@throws Exception
src/test/java/com/alipay/remoting/rpc/serializer/ClassCustomSerializerTest.java