Skip to content

Commit 3feb8df

Browse files
committed
Fix MarkRecording missing-recorder response status
1 parent 5a10ad5 commit 3feb8df

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

server/cmd/api/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func (s *ApiService) MarkRecording(ctx context.Context, req oapi.MarkRecordingRe
266266
rec, exists := s.recordManager.GetRecorder(recorderID)
267267
if !exists {
268268
log.Error("attempted to mark non-existent recording", "recorder_id", recorderID)
269-
return oapi.MarkRecording409JSONResponse{ConflictErrorJSONResponse: oapi.ConflictErrorJSONResponse{Message: "no active recording to mark"}}, nil
269+
return oapi.MarkRecording400JSONResponse{BadRequestErrorJSONResponse: oapi.BadRequestErrorJSONResponse{Message: "no active recording to mark"}}, nil
270270
}
271271

272272
name, offsetMs, err := rec.Mark(req.Body.Name)

server/cmd/api/api/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ func TestApiService_MarkRecording(t *testing.T) {
130130
ctx := context.Background()
131131
name := "checkpoint"
132132

133-
t.Run("no recorder maps to 409", func(t *testing.T) {
133+
t.Run("no recorder maps to 400", func(t *testing.T) {
134134
mgr := recorder.NewFFmpegManager()
135135
svc, err := newSvc(t, mgr)
136136
require.NoError(t, err)
137137

138138
resp, err := svc.MarkRecording(ctx, oapi.MarkRecordingRequestObject{Body: &oapi.MarkRecordingJSONRequestBody{Name: name}})
139139
require.NoError(t, err)
140-
require.IsType(t, oapi.MarkRecording409JSONResponse{}, resp)
140+
require.IsType(t, oapi.MarkRecording400JSONResponse{}, resp)
141141
})
142142

143143
t.Run("missing body maps to 400", func(t *testing.T) {

0 commit comments

Comments
 (0)