Skip to content

Commit 11be3eb

Browse files
committed
Corrects the libraries panic behaviors
This library will no longer swallow panics with this change Closes GH-5
1 parent 676aa70 commit 11be3eb

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

scaler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ func (s Scaler[T, U]) Exec(ctx context.Context, in <-chan T) (<-chan U, error) {
6565
}
6666

6767
go func() {
68-
defer recover()
6968
defer close(out)
7069

7170
wg := sync.WaitGroup{}
@@ -137,7 +136,6 @@ func (s Scaler[T, U]) layer2(ctx context.Context, in <-chan T) <-chan U {
137136
out := make(chan U)
138137

139138
go func() {
140-
defer recover()
141139
defer close(out)
142140

143141
timer := time.NewTimer(s.Life)

stream.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func Intercept[T, U any](
4444
out := make(chan U)
4545

4646
go func() {
47-
defer recover()
4847
defer close(out)
4948

5049
for {
@@ -59,9 +58,6 @@ func Intercept[T, U any](
5958
// Executing this in a function literal ensures that any panic
6059
// will be caught during execution of the function
6160
func() {
62-
// TODO: Should something happen with this panic data?
63-
defer recover()
64-
6561
// Determine if the function was successful
6662
result, ok := fn(ctx, v)
6763
if !ok {
@@ -139,7 +135,6 @@ func FanOut[T any](ctx context.Context, in <-chan T, out ...chan<- T) {
139135
// Closure to catch panic on closed channel write.
140136
// Continue Loop
141137
func() {
142-
defer recover()
143138
select {
144139
case <-ctx.Done():
145140
return

0 commit comments

Comments
 (0)