An Error subclass that wraps a PixivError for use in thrown contexts (e.g. async generators that must throw proper Error objects).
Error
PixivError
All PixivError properties are spread directly onto this instance so that callers can use instanceof PixivFetchError or access error.type etc.
instanceof PixivFetchError
error.type
try { for await (const page of result.pages()) { ... }} catch (e) { if (e instanceof PixivFetchError) { console.error(e.pixivError.type) }} Copy
try { for await (const page of result.pages()) { ... }} catch (e) { if (e instanceof PixivFetchError) { console.error(e.pixivError.type) }}
Optional
Readonly
The underlying structured PixivError.
An
Errorsubclass that wraps aPixivErrorfor use in thrown contexts (e.g. async generators that must throw properErrorobjects).All
PixivErrorproperties are spread directly onto this instance so that callers can useinstanceof PixivFetchErroror accesserror.typeetc.Example