handle panic()

This commit is contained in:
xdrm-brackets 2018-05-06 01:05:52 +02:00
parent 86dba9aa0b
commit ec1722a804
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,12 @@ func main(){
/* (2) Bind default controller */ /* (2) Bind default controller */
serv.BindDefault(func(cli *ws.Client, receiver <-chan ws.Message, sender chan<- ws.Message, bc chan<- ws.Message){ serv.BindDefault(func(cli *ws.Client, receiver <-chan ws.Message, sender chan<- ws.Message, bc chan<- ws.Message){
defer func(){
if (recover() != nil) {
fmt.Printf("*** PANIC\n")
}
}()
for msg := range receiver { for msg := range receiver {
// if receive message -> send it back // if receive message -> send it back