File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ const (
1111 errRecoveryString = "recovering from panic: %+v\n Stack Trace:\n %s"
1212)
1313
14+ // ErrRecovery contains the error when a consumer goroutine needed to be recovers
1415type ErrRecovery struct {
1516 s string
1617}
1718
19+ // Error prints recovery error
1820func (e * ErrRecovery ) Error () string {
1921 return e .s
2022}
Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ func TestPanicRecovery(t *testing.T) {
118118 i := job .Params ()[0 ].(int )
119119 if i == 1 {
120120 panic ("OMG OMG OMG! something bad happened!" )
121- return
122121 }
123122 time .Sleep (time .Second * 1 )
124123 job .Return (i )
@@ -135,7 +134,7 @@ func TestPanicRecovery(t *testing.T) {
135134 err , ok := result .(* ErrRecovery )
136135 if ok {
137136 count ++
138- err .Error ()
137+ NotEqual ( t , len ( err .Error ()), 0 )
139138 }
140139 }
141140
You can’t perform that action at this time.
0 commit comments