remove error wrapping from builder
This commit is contained in:
		@@ -803,7 +803,7 @@ func (b *Builder) mappingFor(resourceOrKindArg string) (*meta.RESTMapping, error
 | 
				
			|||||||
		// if the error is _not_ a *meta.NoKindMatchError, then we had trouble doing discovery,
 | 
							// if the error is _not_ a *meta.NoKindMatchError, then we had trouble doing discovery,
 | 
				
			||||||
		// so we should return the original error since it may help a user diagnose what is actually wrong
 | 
							// so we should return the original error since it may help a user diagnose what is actually wrong
 | 
				
			||||||
		if meta.IsNoMatchError(err) {
 | 
							if meta.IsNoMatchError(err) {
 | 
				
			||||||
			return nil, fmt.Errorf("the server doesn't have a resource type %q: %w", groupResource.Resource, err)
 | 
								return nil, fmt.Errorf("the server doesn't have a resource type %q", groupResource.Resource)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1053,9 +1053,6 @@ func TestRestMappingErrors(t *testing.T) {
 | 
				
			|||||||
		if !strings.Contains(err.Error(), "server doesn't have a resource type \"foo\"") {
 | 
							if !strings.Contains(err.Error(), "server doesn't have a resource type \"foo\"") {
 | 
				
			||||||
			t.Fatalf("unexpected error: %v", err)
 | 
								t.Fatalf("unexpected error: %v", err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if !errors.Is(err, &meta.NoKindMatchError{}) {
 | 
					 | 
				
			||||||
			t.Fatalf("unexpected error type: %v", err)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	expectedErr := fmt.Errorf("expected error")
 | 
						expectedErr := fmt.Errorf("expected error")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user