public static ContextInfo toContextInfo ( final ContextBase context , final ExceptionInfo error ) { final ContextInfo . Builder builder = ContextInfo . newBuilder ( ) . setContextId ( context . getId ( ) ) . setEvaluatorId ( context . getEvaluatorId ( ) ) . setParentId ( context . getParentId ( ) . orElse ( "" ) ) . setEvaluatorDescriptorInfo ( toEvaluatorDescriptorInfo ( context . getEvaluatorDescriptor ( ) ) ) ; if ( error != null ) { builder . setException ( error ) ; } return builder . build ( ) ; }
Create a context info from a context object with an error .