private StatusException throwableToStatusException ( Throwable t ) { String [ ] frames = ExceptionUtils . getStackFrames ( t ) ; Metadata metadata = new Metadata ( ) ; metadata . put ( STATUS_DETAILS_KEY , DebugInfo . newBuilder ( ) . addAllStackEntries ( Arrays . asList ( frames ) ) . setDetail ( ExceptionUtils . getMessage ( t ) ) . build ( ) ) ; return Status . INTERNAL . withDescription ( t . getMessage ( ) ) . withCause ( t ) . asException ( metadata ) ; }
Converts an internal exception thrown by Conductor into an StatusException that uses modern Status metadata for GRPC .