File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
core/src/main/java/io/temporal/samples/earlyreturn Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,24 @@ private static void runWorkflowWithUpdateWithStart(WorkflowClient client) {
7676 + result .getTransactionId ()
7777 + ")" );
7878 } catch (Exception e ) {
79- System .err .println ("Transaction initialization failed: " + e .getMessage ());
80- System .err .println ("Cause: " + e .getCause ());
79+ if (e .getCause () instanceof io .grpc .StatusRuntimeException ) {
80+ io .grpc .StatusRuntimeException sre = (io .grpc .StatusRuntimeException ) e .getCause ();
81+
82+ System .err .println ("Workflow failed with StatusRuntimeException: " + sre .getMessage ());
83+ System .err .println ("Cause: " + e .getCause ());
84+
85+ if (sre .getStatus ().getCode () == io .grpc .Status .Code .PERMISSION_DENIED
86+ && sre .getMessage ()
87+ .contains ("ExecuteMultiOperation API is disabled on this namespace" )) {
88+
89+ // Inform the user that UpdateWithStart requires the ExecuteMultiOperation API to be enabled
90+ System .err .println (
91+ "UpdateWithStart requires the ExecuteMultiOperation API to be enabled on this namespace." );
92+ }
93+ } else {
94+ System .err .println ("Transaction initialization failed: " + e .getMessage ());
95+ System .err .println ("Cause: " + e .getCause ());
96+ }
8197 }
8298 }
8399
You can’t perform that action at this time.
0 commit comments