Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 2,799 for errorea (0.26 sec)

  1. internal/jwt/parser_test.go

    var (
    	defaultKeyFunc = func(claim *MapClaims) ([]byte, error) { return []byte("HelloSecret"), nil }
    	emptyKeyFunc   = func(claim *MapClaims) ([]byte, error) { return nil, nil }
    	errorKeyFunc   = func(claim *MapClaims) ([]byte, error) { return nil, fmt.Errorf("error loading key") }
    )
    
    var jwtTestData = []struct {
    	name        string
    	tokenString string
    	keyfunc     func(*MapClaims) ([]byte, error)
    	claims      jwt.Claims
    	valid       bool
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Nov 05 19:20:08 GMT 2021
    - 6K bytes
    - Viewed (0)
  2. internal/config/identity/ldap/ldap.go

    	if err != nil {
    		errRet := fmt.Errorf("Unable to find user DN: %w", err)
    		return "", nil, errRet
    	}
    
    	// Authenticate the user credentials.
    	err = conn.Bind(bindDN, password)
    	if err != nil {
    		errRet := fmt.Errorf("LDAP auth failed for DN %s: %w", bindDN, err)
    		return "", nil, errRet
    	}
    
    	// Bind to the lookup user account again to perform group search.
    	if err = l.LDAP.LookupBind(conn); err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 18 15:15:02 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  3. src/bufio/scan_test.go

    	testNoNewline(text, lines, t)
    }
    
    var testError = errors.New("testError")
    
    // Test the correct error is returned when the split function errors out.
    func TestSplitError(t *testing.T) {
    	// Create a split function that delivers a little data, then a predictable error.
    	numSplits := 0
    	const okCount = 7
    	errorSplit := func(data []byte, atEOF bool) (advance int, token []byte, err error) {
    		if atEOF {
    			panic("didn't get enough data")
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  4. cmd/admin-handler-utils.go

    		return toAPIError(ctx, fmt.Errorf("error importing %s with: %w", fname, err))
    	}
    	return toAPIError(ctx, fmt.Errorf("error importing %s from %s with: %w", entity, fname, err))
    }
    
    // wraps import error for more context
    func importErrorWithAPIErr(ctx context.Context, apiErr APIErrorCode, err error, fname, entity string) APIError {
    	if entity == "" {
    		return errorCodes.ToAPIErrWithErr(apiErr, fmt.Errorf("error importing %s with: %w", fname, err))
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  5. tests/hooks_test.go

    	if err := DB.Create(&product).Error; err == nil {
    		t.Errorf("should got failed to save, but error is nil")
    	}
    
    	if DB.First(&Product4{}, "name = ?", product.Name).Error == nil {
    		t.Errorf("should got RecordNotFound, but got nil")
    	}
    
    	product = Product4{Name: "Product-2", Price: 100, Item: ProductItem{Code: "valid"}}
    	if err := DB.Create(&product).Error; err != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  6. tests/delete_test.go

    		t.Errorf("errors happened when delete: %v", err)
    	}
    
    	if err := DB.Delete(&User{}).Error; err != gorm.ErrMissingWhereClause {
    		t.Errorf("errors happened when delete: %v", err)
    	}
    
    	if err := DB.Where("id = ?", users[0].ID).First(&result).Error; err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
    		t.Errorf("should returns record not found error, but got %v", err)
    	}
    }
    
    func TestDeleteWithTable(t *testing.T) {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  7. tests/scanner_valuer_test.go

    	if err := DB.Create(&data).Error; err != nil {
    		t.Errorf("Should got no error when creating data, but got %v", err)
    	}
    
    	if err := DB.Model(&data).Update("password", EncryptedData("xnewpass")).Error; err == nil {
    		t.Errorf("Should failed to update data with invalid data")
    	}
    
    	if err := DB.Model(&data).Update("password", EncryptedData("newpass")).Error; err != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  8. tests/soft_delete_test.go

    		t.Errorf("Table with escape character, got %v", sql)
    	}
    
    	if DB.First(&User{}, "name = ?", user.Name).Error == nil {
    		t.Errorf("Can't find a soft deleted record")
    	}
    
    	count = 0
    	if DB.Model(&User{}).Where("name = ?", user.Name).Count(&count).Error != nil || count != 0 {
    		t.Errorf("Count soft deleted record, expects: %v, got: %v", 0, count)
    	}
    
    	age = 0
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  9. internal/kms/single-key.go

    func (secretKey) Metrics(ctx context.Context) (kes.Metric, error) {
    	return kes.Metric{}, Error{
    		HTTPStatusCode: http.StatusNotImplemented,
    		APICode:        "KMS.NotImplemented",
    		Err:            errors.New("metrics are not supported"),
    	}
    }
    
    func (kms secretKey) CreateKey(_ context.Context, keyID string) error {
    	if keyID == kms.keyID {
    		return nil
    	}
    	return Error{
    		HTTPStatusCode: http.StatusNotImplemented,
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  10. tests/named_argument_test.go

    		t.Errorf("should return record not found error, but got %v", err)
    	}
    
    	DB.Delete(&namedUser)
    
    	var result8 NamedUser
    	if err := DB.Where("name1 = @name OR name2 = @name", map[string]interface{}{"name": "jinzhu-new"}).First(&result8).Error; err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Dec 21 11:50:00 GMT 2021
    - 2.7K bytes
    - Viewed (0)
Back to top