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

fix: Return 500 error if flow creation failed #45

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
laurentluce marked this conversation as resolved.
Show resolved Hide resolved
}
resp := apitypes.Flow{FlowId: *flowId, FlowUrls: flowUrls}
return api.PostTenantUuidFlowCreate200JSONResponse(resp), nil
Expand Down
Loading