Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Display JSON 500 error message #235

Merged
merged 1 commit into from
Sep 20, 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: 4 additions & 4 deletions kardinal-cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ func createDevFlow(tenantUuid api_types.Uuid, pairsMap map[string]string, templa
if resp.StatusCode() == 404 {
fmt.Printf("Could not create flow, missing %s: %s\n", resp.JSON404.ResourceType, resp.JSON404.Id)
} else if resp.StatusCode() == 500 {
fmt.Printf("Could not create flow, error %s: %v\n", resp.JSON500.Error, resp.JSON500.Msg)
fmt.Printf("Could not create flow, error %s: %s\n", resp.JSON500.Error, *resp.JSON500.Msg)
laurentluce marked this conversation as resolved.
Show resolved Hide resolved
} else {
fmt.Printf("Failed to create dev flow: %s\n", string(resp.Body))
}
Expand Down Expand Up @@ -893,7 +893,7 @@ func deploy(tenantUuid api_types.Uuid, serviceConfigs []api_types.ServiceConfig,
if resp.StatusCode() == 404 {
fmt.Printf("Could not create flow, missing %s: %s\n", resp.JSON404.ResourceType, resp.JSON404.Id)
} else if resp.StatusCode() == 500 {
fmt.Printf("Could not create flow, error %s: %v\n", resp.JSON500.Error, resp.JSON500.Msg)
fmt.Printf("Could not create flow, error %s: %s\n", resp.JSON500.Error, *resp.JSON500.Msg)
} else {
fmt.Printf("Failed to create dev flow: %s\n", string(resp.Body))
}
Expand Down Expand Up @@ -974,7 +974,7 @@ func createTemplate(tenantUuid api_types.Uuid, templateName string, services []c
if resp.StatusCode() == 404 {
fmt.Printf("Could not create template, missing %s: %s\n", resp.JSON404.ResourceType, resp.JSON404.Id)
} else if resp.StatusCode() == 500 {
fmt.Printf("Could not create template, error %s: %v\n", resp.JSON500.Error, resp.JSON500.Msg)
fmt.Printf("Could not create template, error %s: %s\n", resp.JSON500.Error, *resp.JSON500.Msg)
} else {
fmt.Printf("Failed to create template: %s\n", string(resp.Body))
}
Expand Down Expand Up @@ -1016,7 +1016,7 @@ func listTemplates(tenantUuid api_types.Uuid) {
if resp.StatusCode() == 404 {
fmt.Printf("Could not list templates, missing %s: %s\n", resp.JSON404.ResourceType, resp.JSON404.Id)
} else if resp.StatusCode() == 500 {
fmt.Printf("Could not list templates, error %s: %v\n", resp.JSON500.Error, resp.JSON500.Msg)
fmt.Printf("Could not list templates, error %s: %s\n", resp.JSON500.Error, *resp.JSON500.Msg)
} else {
fmt.Printf("Failed to list templates: %s\n", string(resp.Body))
}
Expand Down
Loading