Exit on permission denied

This commit is contained in:
emile 2015-09-24 11:39:18 +02:00
parent f37349fff7
commit 81af7ab264
2 changed files with 16 additions and 4 deletions

View file

@ -168,9 +168,15 @@ func main() {
go func() {
if len(gloablConfiguration.CertFile) > 0 && len(gloablConfiguration.KeyFile) > 0 {
srv.ListenAndServeTLS(gloablConfiguration.CertFile, gloablConfiguration.KeyFile)
err := srv.ListenAndServeTLS(gloablConfiguration.CertFile, gloablConfiguration.KeyFile)
if (err!= nil ){
log.Fatal("Error creating server: ", err)
}
} else {
srv.ListenAndServe()
err := srv.ListenAndServe()
if (err!= nil ){
log.Fatal("Error creating server: ", err)
}
}
}()
log.Notice("Started")

10
web.go
View file

@ -46,9 +46,15 @@ func (provider *WebProvider) Provide(configurationChan chan<- *Configuration) {
go func() {
if len(provider.CertFile) > 0 && len(provider.KeyFile) > 0 {
http.ListenAndServeTLS(provider.Address,provider.CertFile, provider.KeyFile, systemRouter)
err := http.ListenAndServeTLS(provider.Address,provider.CertFile, provider.KeyFile, systemRouter)
if (err!= nil ){
log.Fatal("Error creating server: ", err)
}
} else {
http.ListenAndServe(provider.Address, systemRouter)
err := http.ListenAndServe(provider.Address, systemRouter)
if (err!= nil ){
log.Fatal("Error creating server: ", err)
}
}
}()
}