public static Throwable getRootCause ( Throwable e ) { while ( e . getCause ( ) != null && ! ( e . getCause ( ) instanceof StatusRuntimeException ) ) { e = e . getCause ( ) ; } return e ; }
Gets the root cause of an exception . It stops at encountering gRPC s StatusRuntimeException .