From ddbf8590e8d79ebea73cff4653be4804a834cfed Mon Sep 17 00:00:00 2001 From: Jake Shorty Date: Sun, 19 Jun 2022 18:28:33 +0000 Subject: [PATCH] Fix error message and JSON keys --- internal/codespaces/api/api.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/codespaces/api/api.go b/internal/codespaces/api/api.go index b13d5847e..162232e74 100644 --- a/internal/codespaces/api/api.go +++ b/internal/codespaces/api/api.go @@ -574,8 +574,8 @@ func (a *API) GetCodespacePreFlight(ctx context.Context, nwo string) (*User, err if resp.StatusCode == http.StatusNotFound { return nil, nil - } else if resp.StatusCode != http.StatusForbidden { - return nil, fmt.Errorf("codespaces cannot be created from that repository") + } else if resp.StatusCode == http.StatusForbidden { + return nil, fmt.Errorf("you cannot create codespaces with that repository") } else if resp.StatusCode != http.StatusOK { return nil, api.HandleHTTPError(resp) } @@ -586,9 +586,9 @@ func (a *API) GetCodespacePreFlight(ctx context.Context, nwo string) (*User, err } var response struct { - BillableOwner User `json:"billableOwner"` + BillableOwner User `json:"billable_owner"` Defaults struct { - DevcontainerPath string `json:"devcontainerPath"` + DevcontainerPath string `json:"devcontainer_path"` Location string `json:"location"` } }