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 AcctRequired
- type AggregateError
- type BadInput
- type BadServerResponse
- type BidderTemporarilyDisabled
- type BlacklistedAcct
- type BlacklistedApp
- type Coder
- type FailedToRequestBids
- type MalformedAcct
- type Severity
- type Timeout
- type Warning
Constants ¶
const ( UnknownErrorCode = 999 TimeoutErrorCode = iota BadInputErrorCode BlacklistedAppErrorCode BadServerResponseErrorCode FailedToRequestBidsErrorCode BidderTemporarilyDisabledErrorCode BlacklistedAcctErrorCode AcctRequiredErrorCode NoConversionRateErrorCode MalformedAcctErrorCode ModuleRejectionErrorCode )
Defines numeric codes for well-known errors.
const ( UnknownWarningCode = 10999 InvalidPrivacyConsentWarningCode = iota + 10000 AccountLevelDebugDisabledWarningCode BidderLevelDebugDisabledWarningCode DisabledCurrencyConversionWarningCode AlternateBidderCodeWarningCode MultiBidWarningCode AdServerTargetingWarningCode BidAdjustmentWarningCode FloorBidRejectionWarningCode )
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 ¶ added in v0.265.0
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 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 BlacklistedAcct ¶
type BlacklistedAcct struct {
Message string
}
BlacklistedAcct should be used when a request account ID matches an entry in the BlacklistedAccts environment variable array
These errors will be written to http.ResponseWriter before canceling execution
func (*BlacklistedAcct) Code ¶
func (err *BlacklistedAcct) Code() int
func (*BlacklistedAcct) Error ¶
func (err *BlacklistedAcct) Error() string
func (*BlacklistedAcct) Severity ¶
func (err *BlacklistedAcct) 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 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 MalformedAcct ¶ added in v0.226.0
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 ¶ added in v0.226.0
func (err *MalformedAcct) Code() int
func (*MalformedAcct) Error ¶ added in v0.226.0
func (err *MalformedAcct) Error() string
func (*MalformedAcct) Severity ¶ added in v0.226.0
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.