diff options
| -rw-r--r-- | xmpp/xmpp.go | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/xmpp/xmpp.go b/xmpp/xmpp.go index 773ea44..5c6e3e9 100644 --- a/xmpp/xmpp.go +++ b/xmpp/xmpp.go @@ -45,8 +45,14 @@ func Run(ch chan Event, jid string, pwd string) {  			default:  				log.Printf("Unknown Event '%d'!\n", ev)  			} -		case _ = <-decoder.data: -			// do something with incoming tokens here +		case token := <-decoder.data: +			switch element := token.(type) { +			case xml.EndElement: +				if element.Name.Local == "error" { +					log.Println("Received stream error!") +					return +				} +			}  		}  	}  }  | 
