Skip to content
Open
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
19 changes: 14 additions & 5 deletions api/pkg/webhooks/errors.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
package webhooks

import "fmt"
import (
"fmt"

"github.com/google/uuid"
)

type WebhookError struct {
msg string
err error
msg string
err error
ReferenceID string
}

// NewWebhookError wraps a failed webhook call. Each error gets its own reference id, which is part of
// the message, so a user can quote it and the platform owner can find the matching log line.
func NewWebhookError(err error) *WebhookError {
referenceID := uuid.New().String()
return &WebhookError{
msg: "error invoking webhook",
err: err,
msg: fmt.Sprintf("error invoking webhook. Please contact the platform owner (reference id: %s)", referenceID),
err: err,
ReferenceID: referenceID,
}
}

Expand Down
2 changes: 1 addition & 1 deletion api/service/projects_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (service *projectsService) UpdateProject(ctx context.Context, project *mode
return nil
}, func(err error) error {
// Print error and return
log.Errorf("error calling webhook - %s, err: %s", ProjectCreatedEvent, err.Error())
log.Errorf("error calling webhook - %s, err: %s", ProjectUpdatedEvent, err.Error())
return err
},
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/go-playground/validator/v10 v10.11.1
github.com/golang-migrate/migrate/v4 v4.11.0
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.7.4
github.com/hashicorp/vault/api v1.9.0
github.com/hashicorp/vault/api/auth/gcp v0.4.0
Expand Down Expand Up @@ -87,7 +88,6 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ const UpdateProjectInfoModal = ({
}
];

const rows = project.labels.map(label => ({
const rows = (project.labels || []).map(label => ({
...label
}));

const originalRows = originalProject.labels.map(label => ({
const originalRows = (originalProject.labels || []).map(label => ({
...label
}));

Expand Down
Loading