Skip to content

Commit 5c2e527

Browse files
committed
[core] put error in the Error field of events
This swaps Error and Message in two kafka events which deviated from the general convention, where Message contains a general, hard-coded string explaining a moment/step that an environment was at, while Error contains the specific error. It was agreed with George and this allow COG to look for "cannot create new environment" and "cannot get newly created environment" message to report the global error of an environment creation failure.
1 parent 9bb0807 commit 5c2e527

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ func (m *RpcServer) doNewEnvironmentAsync(cxt context.Context, userVars map[stri
314314
the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{
315315
EnvironmentId: id.String(),
316316
State: "ERROR",
317-
Error: "cannot create new environment",
318-
Message: err.Error(),
317+
Error: err.Error(),
318+
Message: "cannot create new environment", // GUI listens for this concrete string
319319
LastRequestUser: requestUser,
320320
WorkflowTemplateInfo: &evpb.WorkflowTemplateInfo{
321321
Public: public,
@@ -330,8 +330,8 @@ func (m *RpcServer) doNewEnvironmentAsync(cxt context.Context, userVars map[stri
330330
the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{
331331
EnvironmentId: id.String(),
332332
State: "ERROR",
333-
Error: "cannot get newly created environment",
334-
Message: err.Error(),
333+
Error: err.Error(),
334+
Message: "cannot get newly created environment", // GUI listens for this concrete string
335335
LastRequestUser: requestUser,
336336
WorkflowTemplateInfo: &evpb.WorkflowTemplateInfo{
337337
Public: public,

0 commit comments

Comments
 (0)