Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Return 500 error if flow failed to be created
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentluce committed Sep 25, 2024
1 parent 49c0a79 commit 3b0131f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kontrol-service/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ func (sv *Server) PostTenantUuidFlowCreate(_ context.Context, request api.PostTe

flowId, flowUrls, err := applyProdDevFlow(sv, request.Uuid, patches, templateSpec)
if err != nil {
logrus.Errorf("an error occured while updating dev flow. error was \n: '%v'", err.Error())
return nil, err
errMsg := "An error occurred creating flow"
errResp := api.ErrorJSONResponse{
Error: err.Error(),
Msg: &errMsg,
}
return api.PostTenantUuidFlowCreate500JSONResponse{errResp}, nil
}
resp := apitypes.Flow{FlowId: *flowId, FlowUrls: flowUrls}
return api.PostTenantUuidFlowCreate200JSONResponse(resp), nil
Expand Down

0 comments on commit 3b0131f

Please sign in to comment.