Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-13658 fix updates error response #9

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Conversation

@@ -93,7 +93,8 @@ func (handle *Handler) Handle(w http.ResponseWriter, r *http.Request) {

func handleError(w http.ResponseWriter, err error) {
if err != nil {
if errors.Is(err, &types.ValidationError{}) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors.Is was only working with sentinel errors (e.g errors created with errors.New) so it was failing in this case.

Comment on lines 3 to 9
import (
"errors"
"github.com/containrrr/watchtower/pkg/types"
"net/http"
"net/http/httptest"
"testing"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please format imports


for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_ = httptest.NewRequest(http.MethodGet, "/v1/update", nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actually, was a spill over

@idoqo idoqo requested a review from BupycHuk January 15, 2025 08:43
@idoqo idoqo merged commit a573276 into main Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants