Skip to content

Commit 476f739

Browse files
chore: modify error messages
1 parent 4c0f06a commit 476f739

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

agent/agentcontainers/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ func (api *API) handleDevcontainerDelete(w http.ResponseWriter, r *http.Request)
12781278
api.mu.Unlock()
12791279

12801280
httpapi.Write(ctx, w, http.StatusConflict, codersdk.Response{
1281-
Message: "Unable to delete transitioning Devcontainer",
1281+
Message: "Unable to delete transitioning devcontainer",
12821282
Detail: fmt.Sprintf("Devcontainer %q is currently %s and cannot be deleted.", dc.Name, dc.Status),
12831283
})
12841284
return
@@ -1318,7 +1318,7 @@ func (api *API) handleDevcontainerDelete(w http.ResponseWriter, r *http.Request)
13181318
api.mu.Unlock()
13191319

13201320
httpapi.Write(ctx, w, http.StatusInternalServerError, codersdk.Response{
1321-
Message: "An internal error occurred stopping the container",
1321+
Message: "An error occurred stopping the container",
13221322
Detail: err.Error(),
13231323
})
13241324
return
@@ -1344,7 +1344,7 @@ func (api *API) handleDevcontainerDelete(w http.ResponseWriter, r *http.Request)
13441344
api.mu.Unlock()
13451345

13461346
httpapi.Write(ctx, w, http.StatusInternalServerError, codersdk.Response{
1347-
Message: "An internal error occurred removing the container",
1347+
Message: "An error occurred removing the container",
13481348
Detail: err.Error(),
13491349
})
13501350
return
@@ -1365,7 +1365,7 @@ func (api *API) handleDevcontainerDelete(w http.ResponseWriter, r *http.Request)
13651365
api.mu.Unlock()
13661366

13671367
httpapi.Write(ctx, w, http.StatusInternalServerError, codersdk.Response{
1368-
Message: "An internal error occurred deleting the agent",
1368+
Message: "An error occurred deleting the agent",
13691369
Detail: err.Error(),
13701370
})
13711371
return
@@ -1412,7 +1412,7 @@ func (api *API) handleDevcontainerRecreate(w http.ResponseWriter, r *http.Reques
14121412
api.mu.Unlock()
14131413

14141414
httpapi.Write(ctx, w, http.StatusConflict, codersdk.Response{
1415-
Message: "Unable to recreate transitioning Devcontainer",
1415+
Message: "Unable to recreate transitioning devcontainer",
14161416
Detail: fmt.Sprintf("Devcontainer %q is currently %s and cannot be restarted.", dc.Name, dc.Status),
14171417
})
14181418
return

agent/agentcontainers/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ func TestAPI(t *testing.T) {
11781178
},
11791179
devcontainerCLI: &fakeDevcontainerCLI{},
11801180
wantStatus: http.StatusInternalServerError,
1181-
wantBody: "An internal error occurred stopping the container",
1181+
wantBody: "An error occurred stopping the container",
11821182
},
11831183
{
11841184
name: "Container remove fails",
@@ -1202,7 +1202,7 @@ func TestAPI(t *testing.T) {
12021202
},
12031203
devcontainerCLI: &fakeDevcontainerCLI{},
12041204
wantStatus: http.StatusInternalServerError,
1205-
wantBody: "An internal error occurred removing the container",
1205+
wantBody: "An error occurred removing the container",
12061206
},
12071207
{
12081208
name: "OK with container",

0 commit comments

Comments
 (0)