Interface AdError

  • AdError provides details about failures during ad loading or playing, distinguishing between these two error types.

  • The AdError class includes properties like cause, message, name, and stack to describe the error.

  • Methods available in AdError include getErrorCode, getInnerError, getMessage, getType, and getVastErrorCode, offering different ways to retrieve information about the error.

  • The getInnerError method returns the error that caused the current error, which can be either a native error or an AdError instance, or it can be null if no inner error is present.

  • The getVastErrorCode method can be used to retrieve the VAST error code if available or the default AdError.ErrorCode.UNKNOWN_ERROR if not available.


Extends Error
AdError surfaces information to the user about whether a failure occurred during ad loading or playing. The errorType accessor provides information about whether the error occurred during ad loading or ad playing.
Properties
message
name
stack?
Methods
getErrorCode
Returns the error code.
getInnerError
Returns the Error that caused this one.
getMessage
Returns the message for this error.
getType
Returns the type of this error.
getVastErrorCode
Returns the VAST error code.

Properties


message

message: string

name

name: string

Optional stack

stack?: string

Methods


getErrorCode

getErrorCode(): number
Returns the error code.
Returns
number The error code, as defined in AdError.ErrorCode.

getInnerError

getInnerError(): Error
Returns the Error that caused this one.
Returns
Error Inner error that occurred during processing, or null if this information is unavailable. This error may either be a native error or an AdError, a subclass of a native error. This may return null if the error that caused this one is not available.

getMessage

getMessage(): string
Returns the message for this error.
Returns
string The message for this error.

getType

getType(): string
Returns the type of this error.
Returns
string The type of this error, as defined in AdError.Type.

getVastErrorCode

getVastErrorCode(): number
Returns the VAST error code.
Returns
number If VAST error code is available, returns it, otherwise returns AdError.ErrorCode.UNKNOWN_ERROR.