Skip to content

Commit 1f26349

Browse files
authored
Merge branch 'main' into observability-lib-add-overrides
2 parents 7f90690 + 36ed009 commit 1f26349

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

pkg/types/gateway/action.go

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,24 @@ func (req OutboundHTTPRequest) Hash() string {
7171

7272
// OutboundHTTPResponse represents the response from gateway to workflow node.
7373
type OutboundHTTPResponse struct {
74-
ErrorMessage string `json:"errorMessage,omitempty"` // error message for all errors except HTTP errors returned by external endpoints
75-
IsExternalEndpointError bool `json:"isExternalEndpointError,omitempty"` // indicates whether the error is from a faulty external endpoint (e.g. timeout, response size) vs error introduced internally by gateway execution
76-
StatusCode int `json:"statusCode,omitempty"` // HTTP status code
77-
Headers map[string]string `json:"headers,omitempty"` // HTTP headers
78-
Body []byte `json:"body,omitempty"` // HTTP response body
79-
ExternalEndpointLatency time.Duration `json:"externalEndpointLatency,omitempty"` // Latency of the external endpoint
74+
// ErrorMessage contains error details for gateway-level errors (validation, internal errors, or external endpoint failures like timeouts).
75+
// This field is empty when the request successfully reaches the customer's endpoint and returns a response (regardless of HTTP status code).
76+
ErrorMessage string `json:"errorMessage,omitempty"`
77+
78+
// IsExternalEndpointError indicates the request was sent to the customer's endpoint but failed while sending the request or receiving the response.
79+
// (e.g., connection timeout, response too large, unreachable host). When true, ErrorMessage contains the failure details.
80+
IsExternalEndpointError bool `json:"isExternalEndpointError,omitempty"`
81+
82+
// IsValidationError indicates the request was blocked by the gateway BEFORE being sent to the customer's endpoint
83+
// due to policy violations (e.g., blocked HTTP headers, blocked IP addresses, invalid URL).
84+
// This is distinct from StatusCode 4xx, which would indicate the customer's endpoint received and rejected the request.
85+
IsValidationError bool `json:"isValidationError,omitempty"`
86+
87+
// StatusCode is the HTTP status code returned by the customer's endpoint (e.g., 2xx, 4xx, 5xx).
88+
// This field is only populated when the request successfully reaches the customer's endpoint and the response is received.
89+
StatusCode int `json:"statusCode,omitempty"`
90+
91+
Headers map[string]string `json:"headers,omitempty"` // HTTP headers returned by the customer's endpoint
92+
Body []byte `json:"body,omitempty"` // HTTP response body returned by the customer's endpoint
93+
ExternalEndpointLatency time.Duration `json:"externalEndpointLatency,omitempty"` // Time taken by the customer's endpoint to respond
8094
}

0 commit comments

Comments
 (0)