Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 158 for panic (0.15 sec)

  1. cmd/dummy-data-generator_test.go

    //
    // f(NewDummyDataGen(100, 0)) == f(NewDummyDataGen(50, 0)) + f(NewDummyDataGen(50, 50))
    func NewDummyDataGen(totalLength, skipOffset int64) io.ReadSeeker {
    	if totalLength < 0 {
    		panic("Negative length passed to DummyDataGen!")
    	}
    	if skipOffset < 0 {
    		panic("Negative rotations are not allowed")
    	}
    
    	skipOffset %= int64(len(alphabets))
    	as := make([]byte, 2*len(alphabets))
    	copy(as, alphabets)
    	copy(as[len(alphabets):], alphabets)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  2. internal/logger/logger.go

    	sendLog(ctx, entry)
    }
    
    // ErrCritical is the value panic'd whenever CriticalIf is called.
    var ErrCritical struct{}
    
    // CriticalIf logs the provided error on the console. It fails the
    // current go-routine by causing a `panic(ErrCritical)`.
    func CriticalIf(ctx context.Context, err error, errKind ...interface{}) {
    	if err != nil {
    		LogIf(ctx, "", err, errKind...)
    		panic(ErrCritical)
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 12.2K bytes
    - Viewed (0)
  3. internal/dsync/drwmutex.go

    	dsyncLog = env.Get("_MINIO_DSYNC_TRACE", "0") == "1"
    
    	lockRetryMinInterval = 250 * time.Millisecond
    	if lri := env.Get("_MINIO_LOCK_RETRY_INTERVAL", ""); lri != "" {
    		v, err := strconv.Atoi(lri)
    		if err != nil {
    			panic(err)
    		}
    		lockRetryMinInterval = time.Duration(v) * time.Millisecond
    	}
    
    	lockRetryBackOff = backoffWait(
    		lockRetryMinInterval,
    		100*time.Millisecond,
    		5*time.Second,
    	)
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  4. doc/go1.17_spec.html

    </pre>
    
    <h3 id="Handling_panics">Handling panics</h3>
    
    <p> Two built-in functions, <code>panic</code> and <code>recover</code>,
    assist in reporting and handling <a href="#Run_time_panics">run-time panics</a>
    and program-defined error conditions.
    </p>
    
    <pre class="grammar">
    func panic(interface{})
    func recover() interface{}
    </pre>
    
    <p>
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  5. cmd/postpolicyform.go

    const (
    	policyCondEqual         = "eq"
    	policyCondStartsWith    = "starts-with"
    	policyCondContentLength = "content-length-range"
    )
    
    // toString - Safely convert interface to string without causing panic.
    func toString(val interface{}) string {
    	switch v := val.(type) {
    	case string:
    		return v
    	default:
    		return ""
    	}
    }
    
    // toLowerString - safely convert interface to lower string
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 19 16:45:54 GMT 2024
    - 12.2K bytes
    - Viewed (0)
  6. internal/logger/target/testlogger/testlogger.go

    // Call the returned function to disable logging.
    func (t *testLogger) SetErrorTB(tb testing.TB) func() {
    	return t.setTB(tb, errorMessage)
    }
    
    // SetFatalTB will set the logger to output to tb.Panic.
    // Call the returned function to disable logging.
    func (t *testLogger) SetFatalTB(tb testing.TB) func() {
    	return t.setTB(tb, fatalMessage)
    }
    
    func (t *testLogger) setTB(tb testing.TB, action int32) func() {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 4K bytes
    - Viewed (0)
  7. internal/dsync/dsync-client_test.go

    // It _doesn't_ connect to the remote endpoint. See Call method to see when the
    // connect happens.
    func newClient(endpoint string) NetLocker {
    	u, err := url.Parse(endpoint)
    	if err != nil {
    		panic(err)
    	}
    
    	tr := &http.Transport{
    		Proxy:                 http.ProxyFromEnvironment,
    		MaxIdleConnsPerHost:   1024,
    		WriteBufferSize:       32 << 10, // 32KiB moving up from 4KiB default
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 20 17:36:09 GMT 2022
    - 4.4K bytes
    - Viewed (0)
  8. internal/grid/debug.go

    	for _, manager := range t.Managers {
    		for _, remote := range manager.Targets() {
    			if manager.HostName() == remote {
    				continue
    			}
    			if err := manager.Connection(remote).WaitForConnect(ctx); err != nil {
    				panic(err)
    			}
    		}
    	}
    }
    
    func getHosts(n int) (hosts []string, listeners []net.Listener, err error) {
    	for i := 0; i < n; i++ {
    		l, err := net.Listen("tcp", "127.0.0.1:0")
    		if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 08 18:15:27 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  9. cni/pkg/nodeagent/podcgroupns_test.go

    		Name:      "foo",
    		Namespace: "bar",
    		UID:       types.UID("863b91d4-4b68-4efa-917f-4b560e3e86aa"),
    	}}
    	podUIDNetns, err := n.FindNetnsForPods(map[types.UID]*corev1.Pod{
    		pod.UID: pod,
    	})
    	if err != nil {
    		panic(err)
    	}
    	defer podUIDNetns.Close()
    
    	if len(podUIDNetns) == 0 {
    		t.Fatal("expected to find pod netns")
    	}
    
    	expectedUID := "863b91d4-4b68-4efa-917f-4b560e3e86aa"
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  10. internal/grid/muxserver.go

    		if debugPrint {
    			fmt.Println("Mux", m.ID, "Handler took", time.Since(start).Round(time.Millisecond))
    		}
    		if r := recover(); r != nil {
    			gridLogIf(ctx, fmt.Errorf("grid handler (%v) panic: %v", msg.Handler, r))
    			err := RemoteErr(fmt.Sprintf("handler panic: %v", r))
    			handlerErr = &err
    		}
    		if debugPrint {
    			fmt.Println("muxServer: Mux", m.ID, "Returned with", handlerErr)
    		}
    	}()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.1K bytes
    - Viewed (0)
Back to top