Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 75 for OOPS (0.03 sec)

  1. pkg/test/util/retry/retry_test.go

    			n++
    			return fmt.Errorf("oops")
    		}, MaxAttempts(10), Delay(0))
    		if err == nil {
    			t.Fatalf("expected error")
    		}
    		if n != 10 {
    			t.Fatalf("expected exactly 10 attempts, got %d", n)
    		}
    	})
    
    	t.Run("attempts success", func(t *testing.T) {
    		n := 0
    		err := UntilSuccess(func() error {
    			n++
    			if n == 7 {
    				return nil
    			}
    			return fmt.Errorf("oops")
    		}, MaxAttempts(10), Delay(0))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 19:13:32 UTC 2023
    - 2K bytes
    - Viewed (0)
  2. src/runtime/debug/example_monitor_test.go

    	//
    	//    $ go test -run=ExampleSetCrashOutput_monitor runtime/debug
    	//    panic: oops
    	//    ...stack...
    	//    monitor: saved crash report at /tmp/10804884239807998216.crash
    }
    
    // appmain represents the 'main' function of your application.
    func appmain() {
    	monitor()
    
    	// Run the application.
    	println("hello")
    	panic("oops")
    }
    
    // monitor starts the monitor process, which performs automated
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 15:19:04 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  3. test/fixedbugs/bug266.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    func f() int {
    	defer func() {
    		recover()
    	}()
    	panic("oops")
    }
    
    func g() int {	
    	return 12345
    }
    
    func main() {
    	g()	// leave 12345 on stack
    	x := f()
    	if x != 0 {
    		panic(x)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 363 bytes
    - Viewed (0)
  4. src/cmd/go/testdata/script/test_vet.txt

    -- go.mod --
    module m
    
    go 1.16
    -- p1_test.go --
    package p
    
    import "testing"
    
    func Test(t *testing.T) {
    	t.Logf("%d") // oops
    }
    -- p1.go --
    package p
    
    import "fmt"
    
    func F() {
    	fmt.Printf("%d") // oops
    }
    -- vetall/p.go --
    package p
    
    import "net/http"
    
    func F() {
    	resp, err := http.Head("example.com")
    	defer resp.Body.Close()
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 27 20:14:44 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  5. docs_src/handling_errors/tutorial003.py

    app = FastAPI()
    
    
    @app.exception_handler(UnicornException)
    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
            content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."},
        )
    
    
    @app.get("/unicorns/{name}")
    async def read_unicorn(name: str):
        if name == "yolo":
            raise UnicornException(name=name)
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 626 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial008c_an.py

    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 710 bytes
    - Viewed (0)
  7. src/cmd/go/internal/envcmd/env_test.go

    	"cmd/go/internal/cfg"
    	"fmt"
    	"internal/testenv"
    	"os"
    	"os/exec"
    	"path/filepath"
    	"runtime"
    	"testing"
    	"unicode"
    )
    
    func FuzzPrintEnvEscape(f *testing.F) {
    	f.Add(`$(echo 'cc"'; echo 'OOPS="oops')`)
    	f.Add("$(echo shell expansion 1>&2)")
    	f.Add("''")
    	f.Add(`C:\"Program Files"\`)
    	f.Add(`\\"Quoted Host"\\share`)
    	f.Add("\xfb")
    	f.Add("0")
    	f.Add("")
    	f.Add("''''''''")
    	f.Add("\r")
    	f.Add("\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  8. test/fixedbugs/issue16095.go

    	}
    
    	// Force x to be allocated on the heap.
    	sink = &x
    	sink = nil
    
    	// Go to deferreturn after the panic below.
    	defer func() {
    		recover()
    	}()
    
    	// This call collects the heap-allocated version of x (oops!)
    	runtime.GC()
    
    	// Allocate that same object again and clobber it.
    	y := new([20]byte)
    	for i := 0; i < 20; i++ {
    		y[i] = 99
    	}
    	// Make sure y is heap allocated.
    	sink = y
    
    	panic(nil)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 27 16:48:48 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial008c.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 660 bytes
    - Viewed (0)
  10. docs_src/dependencies/tutorial008c_an_py39.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 700 bytes
    - Viewed (0)
Back to top