Skip to content

Commit 202c004

Browse files
fix: return 404 if job not found (#112)
Co-authored-by: raphaelcoeffic <[email protected]>
1 parent 4c4657b commit 202c004

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/http.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (app *Application) getBuildJobLogs(c *gin.Context) {
132132
if logs == nil {
133133
c.AbortWithStatusJSON(
134134
http.StatusNotFound,
135-
NewErrorResponse("Failed to find job"),
135+
NewErrorResponse("job not found"),
136136
)
137137
return
138138
}
@@ -184,14 +184,14 @@ func (app *Application) buildJobStatus(c *gin.Context) {
184184
return
185185
}
186186
job, err := app.artifactory.GetBuild(req)
187-
if err != nil {
187+
if err != nil && !errors.Is(err, artifactory.ErrBuildNotFound) {
188188
ServiceUnavailableResponse(c, err)
189189
return
190190
}
191191
if job == nil {
192192
c.AbortWithStatusJSON(
193193
http.StatusNotFound,
194-
NewErrorResponse("Failed to find job with requested params"),
194+
NewErrorResponse("no such job"),
195195
)
196196
return
197197
}

0 commit comments

Comments
 (0)