Add logging for missing topic and loading
This commit is contained in:
parent
7e833dbca3
commit
4603b565a5
|
|
@ -78,6 +78,8 @@ func (handler *subscriptionHandler) handlePublish(w http.ResponseWriter, r *http
|
||||||
log.Println("Response:")
|
log.Println("Response:")
|
||||||
res.Write(os.Stdout)
|
res.Write(os.Stdout)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.Println("Topic not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -292,6 +294,7 @@ func (handler *subscriptionHandler) save() error {
|
||||||
func main() {
|
func main() {
|
||||||
handler := &subscriptionHandler{}
|
handler := &subscriptionHandler{}
|
||||||
log.Println(handler.load())
|
log.Println(handler.load())
|
||||||
|
fmt.Printf("%#v\n", handler.Subscribers)
|
||||||
http.Handle("/", handler)
|
http.Handle("/", handler)
|
||||||
log.Fatal(http.ListenAndServe(":80", nil))
|
log.Fatal(http.ListenAndServe(":80", nil))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user