Merge pull request #26 from specode/master

fix some error handling
This commit is contained in:
mattn 2013-11-04 16:37:12 -08:00
commit bb0e2d84ea

View File

@ -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:
@ -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: