Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,219 for panicCh (0.31 sec)

  1. staging/src/k8s.io/apiserver/pkg/server/filters/routine.go

    			handler.ServeHTTP(w, req)
    			return
    		}
    
    		req = req.WithContext(WithTask(ctx, &Task{}))
    		panicCh := make(chan any, 1)
    		go func() {
    			defer func() {
    				if r := recover(); r != nil {
    					panicCh <- r
    				}
    				close(panicCh)
    			}()
    			handler.ServeHTTP(w, req)
    		}()
    
    		if p, ok := <-panicCh; ok {
    			panic(p)
    		}
    
    		ctx = req.Context()
    		if t := TaskFrom(ctx); t != nil && t.Func != nil {
    			t.Func()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Feb 16 10:22:16 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/server/filters/timeout_test.go

    	return r.count
    }
    
    func newHandler(responseCh <-chan string, panicCh <-chan interface{}, writeErrCh chan<- error) http.HandlerFunc {
    	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		select {
    		case resp := <-responseCh:
    			_, err := w.Write([]byte(resp))
    			writeErrCh <- err
    		case panicReason := <-panicCh:
    			panic(panicReason)
    		}
    	})
    }
    
    func TestTimeout(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  3. src/runtime/panic.go

    // This is used to try hard to get a panic stack trace out when exiting.
    var runningPanicDefers atomic.Uint32
    
    // panicking is non-zero when crashing the program for an unrecovered panic.
    var panicking atomic.Uint32
    
    // paniclk is held while printing the panic information and stack trace,
    // so that two concurrent panics don't overlap their output.
    var paniclk mutex
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  4. src/runtime/defer_test.go

    		}
    	}()
    	defer func() {
    		panic("panic2")
    	}()
    	panic("panic1")
    }
    
    // This tests that recover() does not succeed unless it is called directly from a
    // defer function that is directly called by the panic.  Here, we first call it
    // from a defer function that is created by the defer function called directly by
    // the panic.  In
    func TestRecoverMatching(t *testing.T) {
    	defer func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 18:57:24 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/server/filters/wrap.go

    func WithPanicRecovery(handler http.Handler, resolver request.RequestInfoResolver) http.Handler {
    	return withPanicRecovery(handler, func(w http.ResponseWriter, req *http.Request, err interface{}) {
    		if err == http.ErrAbortHandler {
    			// Honor the http.ErrAbortHandler sentinel panic value
    			//
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  6. src/log/log.go

    	os.Exit(1)
    }
    
    // Panic is equivalent to [Print] followed by a call to panic().
    func Panic(v ...any) {
    	s := fmt.Sprint(v...)
    	std.Output(2, s)
    	panic(s)
    }
    
    // Panicf is equivalent to [Printf] followed by a call to panic().
    func Panicf(format string, v ...any) {
    	s := fmt.Sprintf(format, v...)
    	std.Output(2, s)
    	panic(s)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 23 22:56:07 UTC 2023
    - 12.9K bytes
    - Viewed (0)
  7. src/fmt/fmt_test.go

    		}
    	}
    }
    
    // PanicS is a type that panics in String.
    type PanicS struct {
    	message any
    }
    
    // Value receiver.
    func (p PanicS) String() string {
    	panic(p.message)
    }
    
    // PanicGo is a type that panics in GoString.
    type PanicGo struct {
    	message any
    }
    
    // Value receiver.
    func (p PanicGo) GoString() string {
    	panic(p.message)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:55 UTC 2024
    - 58.6K bytes
    - Viewed (0)
  8. src/testing/panic_test.go

    		{
    			desc:  "Issue 48502: call runtime.Goexit in t.Cleanup after panic",
    			flags: []string{"-test.run=^TestGoexitInCleanupAfterPanicHelper$"},
    			want: `panic: die
    	panic: test executed panic(nil) or runtime.Goexit`,
    		},
    		{
    			desc:  "Issue 48515: call t.Run in t.Cleanup should trigger panic",
    			flags: []string{"-test.run=^TestCallRunInCleanupHelper$"},
    			want:  `panic: testing: t.Run called during t.Cleanup`,
    		},
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 16:49:24 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/text/internal/language/tags.go

    	b, err := ParseBase(s)
    	if err != nil {
    		panic(err)
    	}
    	return b
    }
    
    // MustParseScript is like ParseScript, but panics if the given script cannot be
    // parsed. It simplifies safe initialization of Script values.
    func MustParseScript(s string) Script {
    	scr, err := ParseScript(s)
    	if err != nil {
    		panic(err)
    	}
    	return scr
    }
    
    // MustParseRegion is like ParseRegion, but panics if the given region cannot be
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  10. src/sync/oncefunc.go

    				panic(p)
    			}
    		}()
    		f()
    		f = nil      // Do not keep f alive after invoking it.
    		valid = true // Set only if f does not panic.
    	}
    	return func() {
    		once.Do(g)
    		if !valid {
    			panic(p)
    		}
    	}
    }
    
    // OnceValue returns a function that invokes f only once and returns the value
    // returned by f. The returned function may be called concurrently.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 17:31:33 UTC 2023
    - 2K bytes
    - Viewed (0)
Back to top