Skip to content

API ReferenceErrorsClass

StalePythPriceError

Error thrown when a Pyth price is outside the configured freshness window. This is kept distinct from PriceServerError so callers can tell an unavailable price service from a service response that is unsafe to use.

Extends

Constructors

Constructor

new StalePythPriceError(
feedId,
publishTime,
maxAgeSeconds
): StalePythPriceError;

Parameters

ParameterType
feedIdstring
publishTimebigint
maxAgeSecondsnumber

Returns

StalePythPriceError

Overrides

BaseError.constructor

Properties

feedId

readonly feedId: string;

maxAgeSeconds

readonly maxAgeSeconds: number;

publishTime

readonly publishTime: bigint;

Methods

walk()

walk<T>(errorType): T | undefined;

Checks if the provided ErrorType is in the error hierarchy for the current error.

Type Parameters

Type ParameterDescription
T extends ErrorThe type of the error being searched for.

Parameters

ParameterTypeDescription
errorType(…args) => TThe error type to find.

Returns

T | undefined

The error, if it is found in the hierarchy, otherwise undefined.

Inherited from

BaseError.walk