Commit 061fe813 authored by keks's avatar keks

add panic() to chanRe.SetError if Emit fails

parent 3486c987
...@@ -113,7 +113,10 @@ type chanResponseEmitter struct { ...@@ -113,7 +113,10 @@ type chanResponseEmitter struct {
} }
func (re *chanResponseEmitter) SetError(v interface{}, errType cmdkit.ErrorType) { func (re *chanResponseEmitter) SetError(v interface{}, errType cmdkit.ErrorType) {
re.Emit(&cmdkit.Error{Message: fmt.Sprint(v), Code: errType}) err := re.Emit(&cmdkit.Error{Message: fmt.Sprint(v), Code: errType})
if err != nil {
panic(err)
}
} }
func (re *chanResponseEmitter) SetLength(l uint64) { func (re *chanResponseEmitter) SetLength(l uint64) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment