Skip to content

Commit

Permalink
fix some error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
specode committed Nov 4, 2013
1 parent 64821d5 commit b67dc40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xmpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ func (c *Client) init(o *Options) error {

// Next message should be either success or failure.
name, val, err := next(c.p)
if err != nil {
return err
}
switch v := val.(type) {
case *saslSuccess:
case *saslFailure:
Expand Down Expand Up @@ -535,8 +538,8 @@ type clientError struct {
func nextStart(p *xml.Decoder) (xml.StartElement, error) {
for {
t, err := p.Token()
if err != nil {
log.Fatal("token", err)
if err != nil && err != io.EOF {
return nil, err
}
switch t := t.(type) {
case xml.StartElement:
Expand Down

0 comments on commit b67dc40

Please sign in to comment.