package com.netflix.conductor.grpc.server;

import io.grpc.Status;
import io.grpc.stub.StreamObserver;

import java.io.PrintWriter;
import java.io.StringWriter;

public class GRPCUtil {
    private GRPCUtil() {}

    private static String stacktraceToString(Throwable e) {
        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);
        e.printStackTrace(printWriter);
        return stringWriter.toString();
    }

    public static void onError(StreamObserver<?> response, Throwable t) {
        response.onError(Status.INTERNAL
                .withDescription(t.getMessage())
                .augmentDescription(stacktraceToString(t))
                .withCause(t)
                .asException());
    }
}

@@ -100,396 +100,98 @@
 er;%0A
-%0A
 import 
-java.io.PrintWriter;%0Aimport java.io.StringWriter;%0A%0Apublic class GRPCUtil %7B%0A    private GRPCUtil() %7B%7D%0A%0A    private static String stacktraceToString(Throwable e) %7B%0A        StringWriter stringWriter = new StringWriter();%0A        PrintWriter printWriter = new PrintWriter(stringWriter);%0A        e.printStackTrace(printWriter);%0A        return stringWriter.toString();%0A    %7D%0A%0A    public
+org.apache.commons.lang3.exception.ExceptionUtils;%0A%0Apublic interface GRPCUtil %7B%0A   
  sta
@@ -380,26 +380,36 @@
 ion(
-s
+ExceptionUtils.getS
 tack
-t
+T
 race
-ToString
 (t))

Simplify GRPCUtil