Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 854 for panic2 (0.12 sec)

  1. src/runtime/callers_test.go

    		testCallersEqual(t, pcs, want)
    	}()
    	func() {
    		defer func() {
    			r := recover()
    			if r != "panic2" {
    				t.Fatalf("got %v, wanted %v", r, "panic2")
    			}
    		}()
    		func() {
    			defer func() {
    				// Again, panic2 aborts/replaces panic1
    				panic("panic2")
    			}()
    			panic("panic1")
    		}()
    	}()
    }
    
    func TestCallersNilPointerPanic(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 21:36:31 UTC 2023
    - 12.1K bytes
    - Viewed (0)
  2. 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)
  3. src/internal/types/testdata/check/builtins0.go

    	_ = new(f1 /* ERROR "not a type" */ ())
    }
    
    func panic1() {
    	panic() // ERROR "not enough arguments"
    	panic(1, 2) // ERROR "too many arguments"
    	panic(0)
    	panic("foo")
    	panic(false)
    	panic(1<<10)
    	panic(1 << /* ERROR "constant shift overflow" */ 1000)
    	_ = panic /* ERROR "used as value" */ (0)
    
    	var s []byte
    	panic(s)
    	panic(s... /* ERROR "invalid use of ..." */ )
    }
    
    func panic2() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. staging/src/k8s.io/apiserver/pkg/server/filters/timeout_test.go

    		t.Errorf("got Write error of %v; expected %v", err, http.ErrHandlerTimeout)
    	}
    
    	// Panics
    	doPanic <- "inner handler panics"
    	res, err = http.Get(ts.URL)
    	if err != nil {
    		t.Fatal(err)
    	}
    	if res.StatusCode != http.StatusInternalServerError {
    		t.Errorf("got res.StatusCode %d; expected %d due to panic", res.StatusCode, http.StatusInternalServerError)
    	}
    	select {
    	case err := <-gotPanic:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  7. src/syscall/js/js.go

    // It panics if v is not a JavaScript number.
    func (v Value) Int() int {
    	return int(v.float("Value.Int"))
    }
    
    // Bool returns the value v as a bool.
    // It panics if v is not a JavaScript boolean.
    func (v Value) Bool() bool {
    	switch v.ref {
    	case valueTrue.ref:
    		return true
    	case valueFalse.ref:
    		return false
    	default:
    		panic(&ValueError{"Value.Bool", v.Type()})
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 14:35:26 UTC 2024
    - 19.5K bytes
    - Viewed (0)
  8. src/internal/reflectlite/value.go

    	}
    	return f.Name()
    }
    
    // mustBeExported panics if f records that the value was obtained using
    // an unexported field.
    func (f flag) mustBeExported() {
    	if f == 0 {
    		panic(&ValueError{methodName(), 0})
    	}
    	if f&flagRO != 0 {
    		panic("reflect: " + methodName() + " using value obtained using unexported field")
    	}
    }
    
    // mustBeAssignable panics if f records that the value is not assignable,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  9. src/log/slog/value.go

    }
    
    // Int64 returns v's value as an int64. It panics
    // if v is not a signed integer.
    func (v Value) Int64() int64 {
    	if g, w := v.Kind(), KindInt64; g != w {
    		panic(fmt.Sprintf("Value kind is %s, not %s", g, w))
    	}
    	return int64(v.num)
    }
    
    // Uint64 returns v's value as a uint64. It panics
    // if v is not an unsigned integer.
    func (v Value) Uint64() uint64 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  10. src/math/rand/v2/rand.go

    // It panics if n <= 0.
    func (r *Rand) Int64N(n int64) int64 {
    	if n <= 0 {
    		panic("invalid argument to Int64N")
    	}
    	return int64(r.uint64n(uint64(n)))
    }
    
    // Uint64N returns, as a uint64, a non-negative pseudo-random number in the half-open interval [0,n).
    // It panics if n == 0.
    func (r *Rand) Uint64N(n uint64) uint64 {
    	if n == 0 {
    		panic("invalid argument to Uint64N")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 02:25:49 UTC 2024
    - 12.8K bytes
    - Viewed (0)
Back to top