MCPcopy Index your code
hub / github.com/kataras/iris / WithoutServerError

Function WithoutServerError

configuration.go:236–249  ·  view source on GitHub ↗

WithoutServerError will cause to ignore the matched "errors" from the main application's `Run/Listen` function. Usage: err := app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed)) will return `nil` if the server's error was `http/iris#ErrServerClosed`. See `Configuration#IgnoreServerE

(errors ...error)

Source from the content-addressed store, hash-verified

234//
235// Example: https://github.com/kataras/iris/tree/main/_examples/http-server/listen-addr/omit-server-errors
236func WithoutServerError(errors ...error) Configurator {
237 return func(app *Application) {
238 if len(errors) == 0 {
239 return
240 }
241
242 errorsAsString := make([]string, len(errors))
243 for i, e := range errors {
244 errorsAsString[i] = e.Error()
245 }
246
247 app.config.IgnoreServerErrors = append(app.config.IgnoreServerErrors, errorsAsString...)
248 }
249}
250
251// WithoutStartupLog turns off the information send, once, to the terminal when the main server is open.
252var WithoutStartupLog = func(app *Application) {

Callers 1

BuildMethod · 0.85

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…