@@ -68,8 +68,8 @@ func (rec *RequestErrorContext) GetObservations() qosobservations.Observations {
6868// It logs a warning and returns nil.
6969// Implements the gateway.RequestQoSContext interface.
7070func (rec * RequestErrorContext ) GetServicePayload () protocol.Payload {
71- rec .Logger .Warn ().Msg ("Invalid usage : RequestErrorContext.GetServicePayload() should never be called." )
72- return protocol.Payload {}
71+ rec .Logger .Warn ().Msg ("SHOULD NEVER HAPPEN : RequestErrorContext.GetServicePayload() should never be called." )
72+ return protocol .EmptyErrorPayload ()
7373}
7474
7575// UpdateWithResponse should never be called.
@@ -79,14 +79,14 @@ func (rec *RequestErrorContext) UpdateWithResponse(endpointAddr protocol.Endpoin
7979 rec .Logger .With (
8080 "endpoint_addr" , endpointAddr ,
8181 "endpoint_response_len" , len (endpointSerializedResponse ),
82- ).Warn ().Msg ("Invalid usage : RequestErrorContext.UpdateWithResponse() should never be called." )
82+ ).Warn ().Msg ("SHOULD NEVER HAPPEN : RequestErrorContext.UpdateWithResponse() should never be called." )
8383}
8484
8585// UpdateWithResponse should never be called.
8686// It logs a warning and returns a failing selector that logs a warning on all selection attempts.
8787// Implements the gateway.RequestQoSContext interface.
8888func (rec * RequestErrorContext ) GetEndpointSelector () protocol.EndpointSelector {
89- rec .Logger .Warn ().Msg ("Invalid usage : RequestErrorContext.GetEndpointSelector() should never be called." )
89+ rec .Logger .Warn ().Msg ("SHOULD NEVER HAPPEN : RequestErrorContext.GetEndpointSelector() should never be called." )
9090
9191 return errorTrackingSelector {
9292 logger : rec .Logger ,
@@ -107,7 +107,7 @@ type errorTrackingSelector struct {
107107func (ets errorTrackingSelector ) Select (endpoints protocol.EndpointAddrList ) (protocol.EndpointAddr , error ) {
108108 ets .logger .With (
109109 "num_endpoints" , len (endpoints ),
110- ).Warn ().Msg ("Invalid usage : errorTrackingSelector.Select() should never be called." )
110+ ).Warn ().Msg ("SHOULD NEVER HAPPEN : errorTrackingSelector.Select() should never be called." )
111111
112112 return protocol .EndpointAddr ("" ), errInvalidSelectorUsage
113113}
@@ -116,7 +116,7 @@ func (ets errorTrackingSelector) Select(endpoints protocol.EndpointAddrList) (pr
116116// It logs a warning and returns an invalid usage error.
117117// Implements the protocol.EndpointSelector interface.
118118func (ets errorTrackingSelector ) SelectMultiple (endpoints protocol.EndpointAddrList , numEndpoints uint ) (protocol.EndpointAddrList , error ) {
119- ets .logger .Warn ().Msg ("Invalid usage : errorTrackingSelector.SelectMultiple() should never be called." )
119+ ets .logger .Warn ().Msg ("SHOULD NEVER HAPPEN : errorTrackingSelector.SelectMultiple() should never be called." )
120120
121121 return nil , errInvalidSelectorUsage
122122}
0 commit comments