Skip to content

Commit 4d79b3c

Browse files
committed
fix(components/execd): fix missing return statement in response error handling
1 parent 650ef8e commit 4d79b3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/execd/pkg/web/controller/codeinterpreting.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func (c *CodeInterpretingController) ListContexts() {
132132
model.ErrorCodeRuntimeError,
133133
err.Error(),
134134
)
135+
return
135136
}
136137

137138
c.RespondSuccess(contexts)
@@ -156,6 +157,7 @@ func (c *CodeInterpretingController) DeleteContextsByLanguage() {
156157
model.ErrorCodeRuntimeError,
157158
fmt.Sprintf("error deleting code context %s. %v", language, err),
158159
)
160+
return
159161
}
160162

161163
c.RespondSuccess(nil)
@@ -181,14 +183,17 @@ func (c *CodeInterpretingController) DeleteContext() {
181183
model.ErrorCodeContextNotFound,
182184
fmt.Sprintf("context %s not found", contextID),
183185
)
186+
return
184187
} else {
185188
c.RespondError(
186189
http.StatusInternalServerError,
187190
model.ErrorCodeRuntimeError,
188191
fmt.Sprintf("error deleting code context %s. %v", contextID, err),
189192
)
193+
return
190194
}
191195
}
196+
192197
c.RespondSuccess(nil)
193198
}
194199

0 commit comments

Comments
 (0)