mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-11-03 01:43:48 +08:00
api: return 500 instead of 404 in case of non-existing items (#2582)
This is needed to differentiate between calls to non-existent andpoints and calls to valid endpoints, but with an ID pointing to a non-existing item, and to return JSON in the latter case.
This commit is contained in:
@@ -383,7 +383,7 @@ func (pm *pathManager) doAPIPathsList(req pathAPIPathsListReq) {
|
||||
func (pm *pathManager) doAPIPathsGet(req pathAPIPathsGetReq) {
|
||||
path, ok := pm.paths[req.name]
|
||||
if !ok {
|
||||
req.res <- pathAPIPathsGetRes{err: errAPINotFound}
|
||||
req.res <- pathAPIPathsGetRes{err: fmt.Errorf("path not found")}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user