mirror of
https://github.com/aler9/rtsp-simple-server
synced 2026-04-22 15:07:19 +08:00
playback: return errors as JSON (#5656)
this is aligned with all other HTTP-based services.
This commit is contained in:
@@ -101,7 +101,10 @@ func (s *Server) writeError(ctx *gin.Context, status int, err error) {
|
||||
s.Log(logger.Error, err.Error())
|
||||
|
||||
// add error to response
|
||||
ctx.String(status, err.Error())
|
||||
ctx.AbortWithStatusJSON(status, &defs.APIError{
|
||||
Status: defs.APIErrorStatusError,
|
||||
Error: err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Server) writeErrorNoLog(ctx *gin.Context, status int, err error) {
|
||||
|
||||
Reference in New Issue
Block a user