Skip to main content

Class: SeasonNotFoundError

Defined in: src/core/errors.ts:353

A requested season is outside what the source supports.

Example​

import sdv, { SeasonNotFoundError } from 'sportsdataverse';

try {
await sdv.nfl.loadNflPbp({ seasons: [1950] });
} catch (err) {
if (err instanceof SeasonNotFoundError) console.warn(err.message);
else throw err;
}

Remarks​

Takes the SdvError constructor: (message, options?); it carries no url.

Extends​

Constructors​

Constructor​

new SeasonNotFoundError(message, options?): SeasonNotFoundError

Defined in: src/core/errors.ts:224

Parameters​

message​

string

Human-readable message; callers redact it (see redactSecrets).

options?​

{ cause } as for Error; the cause is stored through safeCause. When options has no cause key, no cause is attached.

cause?​

unknown

Returns​

SeasonNotFoundError

Inherited from​

SdvError.constructor