mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 19:34:19 +00:00
Show error when ListenAndServe fails
and exit with 1
This commit is contained in:
parent
59f436052e
commit
ae019e4dc3
1 changed files with 5 additions and 1 deletions
6
app.go
6
app.go
|
@ -249,7 +249,11 @@ func Serve() {
|
|||
http.Handle("/", r)
|
||||
log.Info("Serving on http://localhost:%d\n", app.cfg.Server.Port)
|
||||
log.Info("---")
|
||||
http.ListenAndServe(fmt.Sprintf(":%d", app.cfg.Server.Port), nil)
|
||||
err = http.ListenAndServe(fmt.Sprintf(":%d", app.cfg.Server.Port), nil)
|
||||
if err != nil {
|
||||
log.Error("Unable to start: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func connectToDatabase(app *app) {
|
||||
|
|
Loading…
Reference in a new issue