added more user friendly error message in case ServeEvent.Next() is not invoked

This commit is contained in:
Gani Georgiev 2024-11-01 19:10:33 +02:00
parent 1a1e3a2741
commit d3ca24e509
1 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,10 @@ func Serve(app core.App, config ServeConfig) error {
return serveHookErr return serveHookErr
} }
if listener == nil {
return errors.New("The OnServe finalizer wasn't invoked. Did you forget to call the ServeEvent.Next() method?")
}
if config.ShowStartBanner { if config.ShowStartBanner {
schema := "http" schema := "http"
addr := server.Addr addr := server.Addr