Remove panics/fatal errors.

Fixes #9.

This makes shutdown a little more graceful, but there's more
work to be done here. Namely, all outstanding cookies need to
be given the error, otherwise they will block forever.
This commit is contained in:
Andrew Gallant
2015-04-26 19:04:54 -04:00
committed by Přemysl Janouch
parent dd00568d44
commit 5451e59f88
2 changed files with 28 additions and 40 deletions

View File

@@ -99,7 +99,6 @@ func (c Cookie) replyChecked() ([]byte, error) {
case err := <-c.errorChan:
return nil, err
}
panic("unreachable")
}
// replyUnchecked waits for a response on either the replyChan or pingChan
@@ -123,7 +122,6 @@ func (c Cookie) replyUnchecked() ([]byte, error) {
case <-c.pingChan:
return nil, nil
}
panic("unreachable")
}
// Check is used for checked requests that have no replies. It is a mechanism
@@ -164,5 +162,4 @@ func (c Cookie) Check() error {
case <-c.pingChan:
return nil
}
panic("unreachable")
}