Class: TransportUnavailableError
Defined in: src/core/errors.ts:375
An optional transport dependency (e.g. impit) is not installed.
Example
import sdv, { configure, createImpersonatingTransport, TransportUnavailableError } from 'sportsdataverse';
configure({ transport: { nba_stats: createImpersonatingTransport() } });
try {
await sdv.nba.nbaStatsLeaguedashplayerstats({ leagueId: '00' });
} catch (err) {
if (err instanceof TransportUnavailableError) console.error('run: npm install impit');
else throw err;
}
Remarks
Thrown by the transport from createImpersonatingTransport() on every call until
impit can be imported; its cause is the import error. request() never retries
an SdvError, so it reaches the caller on the first attempt.
Extends
Constructors
Constructor
new TransportUnavailableError(
message,options?):TransportUnavailableError
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
TransportUnavailableError