Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ All notable changes to the Docker Language Server will be documented in this fil

### Fixed

- Dockerfile
- textDocument/hover
- ignore 4XX errors when hovering over images with a non-standard tag ([#371](https://github.com/docker/docker-language-server/issues/371))
- Compose
- textDocument/documentLink
- stop returning links for alias nodes in included paths ([#439](https://github.com/docker/docker-language-server/issues/439))
Expand Down
4 changes: 3 additions & 1 deletion internal/scout/languageGatewayClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ func (c LanguageGatewayClientImpl) PostImage(ctx context.Context, jwt, image str
}

defer func() { _ = res.Body.Close() }()
if res.StatusCode != 200 {
if res.StatusCode >= 500 {
err := fmt.Errorf("http request failed (%v status code)", res.StatusCode)
return ImageResponse{}, err
} else if res.StatusCode >= 400 {
return ImageResponse{}, nil
}

var imageResponse ImageResponse
Expand Down
3 changes: 2 additions & 1 deletion internal/scout/languageGatewayClient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ func TestPostImage(t *testing.T) {
response ImageResponse
}{
{
// this triggers a 400 which is ignored
image: "alpine:3.16.1::",
err: errors.New("http request failed (400 status code)"),
err: nil,
},
{
image: "alpine:3.16.1",
Expand Down
1 change: 1 addition & 0 deletions internal/scout/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (s *ServiceImpl) Hover(ctx context.Context, documentURI protocol.DocumentUr
},
}, nil
}
return nil, nil
}
return nil, err
}
Expand Down
Loading