server: cleanup error

This commit is contained in:
aler9
2021-11-12 17:26:18 +01:00
committed by Alessandro Ros
parent 61674c0ccb
commit 3ead94477f
2 changed files with 2 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ type ErrServerUnhandledRequest struct {
// Error implements the error interface. // Error implements the error interface.
func (e ErrServerUnhandledRequest) Error() string { func (e ErrServerUnhandledRequest) Error() string {
return fmt.Sprintf("unhandled request (%v %v)", e.Req.Method, e.Req.URL) return fmt.Sprintf("unhandled request: %v %v", e.Req.Method, e.Req.URL)
} }
// ErrServerInvalidState is an error that can be returned by a server. // ErrServerInvalidState is an error that can be returned by a server.

View File

@@ -659,7 +659,7 @@ func TestServerErrorInvalidMethod(t *testing.T) {
s := &Server{ s := &Server{
Handler: &testServerHandler{ Handler: &testServerHandler{
onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) { onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) {
require.EqualError(t, ctx.Error, "unhandled request (INVALID rtsp://localhost:8554/)") require.EqualError(t, ctx.Error, "unhandled request: INVALID rtsp://localhost:8554/")
close(connClosed) close(connClosed)
}, },
}, },