Documentation ¶
Index ¶
- Constants
- func ContainsFatalError(errors []error) bool
- func FatalOnly(errs []error) []error
- func IsWarning(err error) bool
- func ReadCode(err error) int
- func WarningOnly(errs []error) []error
- type AccountDisabled
- type AcctRequired
- type AggregateError
- type BadInput
- type BadServerResponse
- type BidderTemporarilyDisabled
- type BlacklistedApp
- type Coder
- type FailedToMarshal
- type FailedToRequestBids
- type FailedToUnmarshal
- type MalformedAcct
- type Severity
- type Timeout
- type TmaxTimeout
- type Warning
Constants ¶
const ( UnknownErrorCode = 999 TimeoutErrorCode = iota BadInputErrorCode BlacklistedAppErrorCode BadServerResponseErrorCode FailedToRequestBidsErrorCode BidderTemporarilyDisabledErrorCode AccountDisabledErrorCode AcctRequiredErrorCode NoConversionRateErrorCode MalformedAcctErrorCode ModuleRejectionErrorCode TmaxTimeoutErrorCode FailedToMarshalErrorCode FailedToUnmarshalErrorCode )
Defines numeric codes for well-known errors.
const ( UnknownWarningCode = 10999 InvalidPrivacyConsentWarningCode = iota + 10000 AccountLevelDebugDisabledWarningCode BidderLevelDebugDisabledWarningCode DisabledCurrencyConversionWarningCode AlternateBidderCodeWarningCode MultiBidWarningCode AdServerTargetingWarningCode BidAdjustmentWarningCode FloorBidRejectionWarningCode InvalidBidResponseDSAWarningCode )
Defines numeric codes for well-known warnings.
Variables ¶
This section is empty.
Functions ¶
func ContainsFatalError ¶
ContainsFatalError checks if the error list contains a fatal error.
func IsWarning ¶
IsWarning returns true if an error is labeled with a Severity of SeverityWarning Throughout the codebase, errors with SeverityWarning are of the type Warning defined in this package
func WarningOnly ¶
WarningOnly returns a new error list with only the warning severity errors.
Types ¶
type AccountDisabled ¶
type AccountDisabled struct {
Message string
}
AccountDisabled should be used when a request an account is specifically disabled in account config.
func (*AccountDisabled) Code ¶
func (err *AccountDisabled) Code() int
func (*AccountDisabled) Error ¶
func (err *AccountDisabled) Error() string
func (*AccountDisabled) Severity ¶
func (err *AccountDisabled) Severity() Severity
type AcctRequired ¶
type AcctRequired struct {
Message string
}
AcctRequired should be used when the environment variable ACCOUNT_REQUIRED has been set to not process requests that don't come with a valid account ID
These errors will be written to http.ResponseWriter before canceling execution
func (*AcctRequired) Code ¶
func (err *AcctRequired) Code() int
func (*AcctRequired) Error ¶
func (err *AcctRequired) Error() string
func (*AcctRequired) Severity ¶
func (err *AcctRequired) Severity() Severity
type AggregateError ¶
AggregateError represents one or more errors.
func NewAggregateError ¶
func NewAggregateError(msg string, errs []error) AggregateError
NewAggregateError builds a AggregateError struct.
func (AggregateError) Error ¶
func (e AggregateError) Error() string
Error implements the standard error interface.
type BadInput ¶
type BadInput struct {
Message string
}
BadInput should be used when returning errors which are caused by bad input. It should _not_ be used if the error is a server-side issue (e.g. failed to send the external request).
BadInputs will not be written to the app log, since it's not an actionable item for the Prebid Server hosts.
type BadServerResponse ¶
type BadServerResponse struct {
Message string
}
BadServerResponse should be used when returning errors which are caused by bad/unexpected behavior on the remote server.
For example:
- The external server responded with a 500
- The external server gave a malformed or unexpected response.
These should not be used to log _connection_ errors (e.g. "couldn't find host"), which may indicate config issues for the PBS host company
func (*BadServerResponse) Code ¶
func (err *BadServerResponse) Code() int
func (*BadServerResponse) Error ¶
func (err *BadServerResponse) Error() string
func (*BadServerResponse) Severity ¶
func (err *BadServerResponse) Severity() Severity
type BidderTemporarilyDisabled ¶
type BidderTemporarilyDisabled struct {
Message string
}
BidderTemporarilyDisabled is used at the request validation step, where we want to continue processing as best we can rather than returning a 4xx, and still return an error message. The initial usecase is to flag deprecated bidders.
func (*BidderTemporarilyDisabled) Code ¶
func (err *BidderTemporarilyDisabled) Code() int
func (*BidderTemporarilyDisabled) Error ¶
func (err *BidderTemporarilyDisabled) Error() string
func (*BidderTemporarilyDisabled) Severity ¶
func (err *BidderTemporarilyDisabled) Severity() Severity
type BlacklistedApp ¶
type BlacklistedApp struct {
Message string
}
BlacklistedApp should be used when a request App.ID matches an entry in the BlacklistedApps environment variable array
These errors will be written to http.ResponseWriter before canceling execution
func (*BlacklistedApp) Code ¶
func (err *BlacklistedApp) Code() int
func (*BlacklistedApp) Error ¶
func (err *BlacklistedApp) Error() string
func (*BlacklistedApp) Severity ¶
func (err *BlacklistedApp) Severity() Severity
type FailedToMarshal ¶
type FailedToMarshal struct {
Message string
}
FailedToMarshal should be used to represent errors that occur when marshaling to a byte slice.
func (*FailedToMarshal) Code ¶
func (err *FailedToMarshal) Code() int
func (*FailedToMarshal) Error ¶
func (err *FailedToMarshal) Error() string
func (*FailedToMarshal) Severity ¶
func (err *FailedToMarshal) Severity() Severity
type FailedToRequestBids ¶
type FailedToRequestBids struct {
Message string
}
FailedToRequestBids is an error to cover the case where an adapter failed to generate any http requests to get bids, but did not generate any error messages. This should not happen in practice and will signal that an adapter is poorly coded. If there was something wrong with a request such that an adapter could not generate a bid, then it should generate an error explaining the deficiency. Otherwise it will be extremely difficult to debug the reason why an adapter is not bidding.
func (*FailedToRequestBids) Code ¶
func (err *FailedToRequestBids) Code() int
func (*FailedToRequestBids) Error ¶
func (err *FailedToRequestBids) Error() string
func (*FailedToRequestBids) Severity ¶
func (err *FailedToRequestBids) Severity() Severity
type FailedToUnmarshal ¶
type FailedToUnmarshal struct {
Message string
}
FailedToUnmarshal should be used to represent errors that occur when unmarshaling raw json.
func (*FailedToUnmarshal) Code ¶
func (err *FailedToUnmarshal) Code() int
func (*FailedToUnmarshal) Error ¶
func (err *FailedToUnmarshal) Error() string
func (*FailedToUnmarshal) Severity ¶
func (err *FailedToUnmarshal) Severity() Severity
type MalformedAcct ¶
type MalformedAcct struct {
Message string
}
MalformedAcct should be used when the retrieved account config cannot be unmarshaled These errors will be written to http.ResponseWriter before canceling execution
func (*MalformedAcct) Code ¶
func (err *MalformedAcct) Code() int
func (*MalformedAcct) Error ¶
func (err *MalformedAcct) Error() string
func (*MalformedAcct) Severity ¶
func (err *MalformedAcct) Severity() Severity
type Severity ¶
type Severity int
Severity represents the severity level of a bid processing error.
const ( // SeverityUnknown represents an unknown severity level. SeverityUnknown Severity = iota // SeverityFatal represents a fatal bid processing error which prevents a bid response. SeverityFatal // SeverityWarning represents a non-fatal bid processing error where invalid or ambiguous // data in the bid request was ignored. SeverityWarning )
type Timeout ¶
type Timeout struct {
Message string
}
Timeout should be used to flag that a bidder failed to return a response because the PBS timeout timer expired before a result was received.
Timeouts will not be written to the app log, since it's not an actionable item for the Prebid Server hosts.
type TmaxTimeout ¶
type TmaxTimeout struct {
Message string
}
TmaxTimeout should be used to flag that remaining tmax duration is not enough to get response from bidder
TmaxTimeout will not be written to the app log, since it's not an actionable item for the Prebid Server hosts.
func (*TmaxTimeout) Code ¶
func (err *TmaxTimeout) Code() int
func (*TmaxTimeout) Error ¶
func (err *TmaxTimeout) Error() string
func (*TmaxTimeout) Severity ¶
func (err *TmaxTimeout) Severity() Severity