Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 965 for handler (0.34 sec)

  1. cmd/object-handlers_test.go

    			t.Fatalf("Test %d: %s: Failed to create HTTP request for Head Object: <ERROR> %v", i+1, instanceType, err)
    		}
    		// Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler.
    		// Call the ServeHTTP to execute the handler,`func (api objectAPIHandlers) GetObjectHandler`  handles the request.
    		apiRouter.ServeHTTP(rec, req)
    
    		// Assert the response code with the expected status.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 160K bytes
    - Viewed (0)
  2. cmd/generic-handlers.go

    		}
    		h.ServeHTTP(w, r)
    	})
    }
    
    // criticalErrorHandler handles panics and fatal errors by
    // `panic(logger.ErrCritical)` as done by `logger.CriticalIf`.
    //
    // It should be always the first / highest HTTP handler.
    func setCriticalErrorHandler(h http.Handler) http.Handler {
    	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		defer func() {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 01:08:52 GMT 2024
    - 20.7K bytes
    - Viewed (0)
  3. internal/grid/connection.go

    			return newMuxStateless(ctx, m, c, *handler)
    		})
    	} else {
    		// Stream:
    		var handler *StreamHandler
    		if subID == nil {
    			if !m.Handler.valid() {
    				gridLogIf(ctx, c.queueMsg(m, muxConnectError{Error: "Invalid Handler"}))
    				return
    			}
    			handler = c.handlers.streams[m.Handler]
    		} else {
    			handler = c.handlers.subStreams[*subID]
    		}
    		if handler == nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  4. cmd/bucket-handlers_test.go

    	if err != nil {
    		t.Fatalf("Test %s: Failed to create HTTP request for RemoveBucketHandler: <ERROR> %v", instanceType, err)
    	}
    	// Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler.
    	// Call the ServeHTTP to execute the handler.
    	apiRouter.ServeHTTP(rec, req)
    	switch rec.Code {
    	case http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNoContent:
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 39.5K bytes
    - Viewed (2)
  5. cmd/bucket-policy-handlers_test.go

    			t.Fatalf("Test %d: Failed to create HTTP request for GetBucketPolicyHandler: <ERROR> %v", i+1, err)
    		}
    		// Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler.
    		// Call the ServeHTTP to execute the handler, GetBucketPolicyHandler handles the request.
    		apiRouter.ServeHTTP(recV4, reqV4)
    		// Assert the response code with the expected status.
    		if recV4.Code != testCase.expectedRespStatus {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 32.7K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/handling-errors.md

    And it also includes a default exception handler for it.
    
    To override it, import the `RequestValidationError` and use it with `@app.exception_handler(RequestValidationError)` to decorate the exception handler.
    
    The exception handler will receive a `Request` and the exception.
    
    ```Python hl_lines="2  14-16"
    {!../../../docs_src/handling_errors/tutorial004.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  7. internal/grid/README.md

    From this connection individual requests can be made.
    
    Each handler, with optional subroutes can be registered with the manager using 
    `Manager.RegisterXHandler(handlerID, handler, subroutes...)`.
    
    A `Handler()` function provides an HTTP handler, which should be hooked up to the appropriate route on the server.
    
    Plain Text
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  8. internal/grid/muxserver.go

    			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)
    		}
    	}()
    	// handlerErr is guarded by 'send' channel.
    	handlerErr = handler.Handle(ctx, msg.Payload, handlerIn, send)
    	return 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)
  9. tests/test_exception_handlers.py

    app = FastAPI(
        exception_handlers={
            HTTPException: http_exception_handler,
            RequestValidationError: request_validation_exception_handler,
            Exception: server_error_exception_handler,
        }
    )
    
    client = TestClient(app)
    
    
    @app.get("/http-exception")
    def route_with_http_exception():
        raise HTTPException(status_code=400)
    
    
    @app.get("/request-validation/{param}/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  10. fastapi/exception_handlers.py

        )
    
    
    async def request_validation_exception_handler(
        request: Request, exc: RequestValidationError
    ) -> JSONResponse:
        return JSONResponse(
            status_code=HTTP_422_UNPROCESSABLE_ENTITY,
            content={"detail": jsonable_encoder(exc.errors())},
        )
    
    
    async def websocket_request_validation_exception_handler(
        websocket: WebSocket, exc: WebSocketRequestValidationError
    ) -> None:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
Back to top