# Table of Contents - [impit](#impit) - [impit](#impit) - [ConnectError | impit](#connecterror-impit) - [CloseError | impit](#closeerror-impit) - [ConnectTimeout | impit](#connecttimeout-impit) - [CookieConflict | impit](#cookieconflict-impit) - [impit documentation](#impit-documentation) - [DecodingError | impit](#decodingerror-impit) - [HTTPError | impit](#httperror-impit) - [Impit | impit](#impit-impit) - [ImpitError | impit](#impiterror-impit) - [ImpitResponse | impit](#impitresponse-impit) - [LocalProtocolError | impit](#localprotocolerror-impit) - [InvalidURL | impit](#invalidurl-impit) - [NetworkError | impit](#networkerror-impit) - [PoolTimeout | impit](#pooltimeout-impit) - [ProxyAuthRequired | impit](#proxyauthrequired-impit) - [ProxyError | impit](#proxyerror-impit) - [ProtocolError | impit](#protocolerror-impit) - [ReadError | impit](#readerror-impit) - [HTTPStatusError | impit](#httpstatuserror-impit) - [ReadTimeout | impit](#readtimeout-impit) - [ProxyTunnelError | impit](#proxytunnelerror-impit) - [RemoteProtocolError | impit](#remoteprotocolerror-impit) - [RequestError | impit](#requesterror-impit) - [RequestNotRead | impit](#requestnotread-impit) - [ResponseNotRead | impit](#responsenotread-impit) - [TimeoutError | impit](#timeouterror-impit) - [StreamConsumed | impit](#streamconsumed-impit) - [StreamError | impit](#streamerror-impit) - [TooManyRedirects | impit](#toomanyredirects-impit) - [StreamClosed | impit](#streamclosed-impit) - [UnsupportedProtocol | impit](#unsupportedprotocol-impit) - [TransportError | impit](#transporterror-impit) - [WriteTimeout | impit](#writetimeout-impit) - [WriteError | impit](#writeerror-impit) - [RequestInit | impit](#requestinit-impit) - [Browser | impit](#browser-impit) - [ImpitOptions | impit](#impitoptions-impit) - [ImpitWrapper | impit](#impitwrapper-impit) - [HttpMethod | impit](#httpmethod-impit) - [TypedArray | impit](#typedarray-impit) - [AsyncClient - impit documentation](#asyncclient-impit-documentation) - [Client - impit documentation](#client-impit-documentation) - [Unknown](#unknown) - [Response - impit documentation](#response-impit-documentation) --- # impit impit ===== `impit` for JavaScript[](https://apify.github.io/impit/js/#for-javascript) =========================================================================== > This documents the `impit` Node.JS package, which provides JavaScript bindings for the `impit` library. > > See documentation for the Python version of `impit` [here](https://apify.github.io/impit/python/) > . `impit` is a Node.JS module that provides bindings for the [`impit`](https://github.com/apify/impit) library. It allows you to switch the TLS fingerprints and the HTTP headers of your requests, while still using the same API as the built-in (since Node.JS 18) `fetch` function. Installation[](https://apify.github.io/impit/js/#installation) --------------------------------------------------------------- npm install impit Installing the root package (`impit`) with the package manager of your choice will also install the correct prebuilt binary for your platform. ### Compatibility[](https://apify.github.io/impit/js/#compatibility) | Operating System | Architecture | libc implementation | Prebuilt binaries available | | --- | --- | --- | --- | | Linux | x86\_64 | glibc | ✅ | | Linux | x86\_64 | musl | ✅ | | Linux | arm64 | glibc | ✅ | | Linux | arm64 | musl | ✅ | | macOS | x86\_64 | N/A | ✅ | | Windows | x86\_64 | N/A | ✅ | | macOS | arm64 | N/A | ✅ | | Windows | arm64 | N/A | ✅ | Usage[](https://apify.github.io/impit/js/#usage) ------------------------------------------------- import { Impit } from 'impit';// Set up the Impit instanceconst impit = new Impit({ browser: "chrome", // or "firefox" proxyUrl: "http://localhost:8080", ignoreTlsErrors: true,});// Use the `fetch` method as you would with the built-in `fetch` functionconst response = await impit.fetch("https://example.com");console.log(response.status);console.log(response.headers);console.log(await response.text());// console.log(await response.json());// ...// Override redirect behavior per request (default: follows instance-level setting)const manualResponse = await impit.fetch("https://example.com/login", { redirect: "manual", // "follow" | "manual" | "error"});if (manualResponse.status === 302) { console.log("Redirect to:", manualResponse.headers.get("location"));} ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page [for JavaScript](https://apify.github.io/impit/js/#for-javascript) * [Installation](https://apify.github.io/impit/js/#installation) * * [Compatibility](https://apify.github.io/impit/js/#compatibility) * [Usage](https://apify.github.io/impit/js/#usage) MMNEPVFCICPMFPCPTTAAATR --- # impit impit ===== Classes ------- [CloseError](https://apify.github.io/impit/js/classes/CloseError.html) [](https://apify.github.io/impit/js/modules.html#closeerror) [ConnectError](https://apify.github.io/impit/js/classes/ConnectError.html) [](https://apify.github.io/impit/js/modules.html#connecterror) [ConnectTimeout](https://apify.github.io/impit/js/classes/ConnectTimeout.html) [](https://apify.github.io/impit/js/modules.html#connecttimeout) [CookieConflict](https://apify.github.io/impit/js/classes/CookieConflict.html) [](https://apify.github.io/impit/js/modules.html#cookieconflict) [DecodingError](https://apify.github.io/impit/js/classes/DecodingError.html) [](https://apify.github.io/impit/js/modules.html#decodingerror) [HTTPError](https://apify.github.io/impit/js/classes/HTTPError.html) [](https://apify.github.io/impit/js/modules.html#httperror) [HTTPStatusError](https://apify.github.io/impit/js/classes/HTTPStatusError.html) [](https://apify.github.io/impit/js/modules.html#httpstatuserror) [Impit](https://apify.github.io/impit/js/classes/Impit.html) [](https://apify.github.io/impit/js/modules.html#impit) [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) [](https://apify.github.io/impit/js/modules.html#impiterror) [ImpitResponse](https://apify.github.io/impit/js/classes/ImpitResponse.html) [](https://apify.github.io/impit/js/modules.html#impitresponse) [InvalidURL](https://apify.github.io/impit/js/classes/InvalidURL.html) [](https://apify.github.io/impit/js/modules.html#invalidurl) [LocalProtocolError](https://apify.github.io/impit/js/classes/LocalProtocolError.html) [](https://apify.github.io/impit/js/modules.html#localprotocolerror) [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) [](https://apify.github.io/impit/js/modules.html#networkerror) [PoolTimeout](https://apify.github.io/impit/js/classes/PoolTimeout.html) [](https://apify.github.io/impit/js/modules.html#pooltimeout) [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) [](https://apify.github.io/impit/js/modules.html#protocolerror) [ProxyAuthRequired](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html) [](https://apify.github.io/impit/js/modules.html#proxyauthrequired) [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) [](https://apify.github.io/impit/js/modules.html#proxyerror) [ProxyTunnelError](https://apify.github.io/impit/js/classes/ProxyTunnelError.html) [](https://apify.github.io/impit/js/modules.html#proxytunnelerror) [ReadError](https://apify.github.io/impit/js/classes/ReadError.html) [](https://apify.github.io/impit/js/modules.html#readerror) [ReadTimeout](https://apify.github.io/impit/js/classes/ReadTimeout.html) [](https://apify.github.io/impit/js/modules.html#readtimeout) [RemoteProtocolError](https://apify.github.io/impit/js/classes/RemoteProtocolError.html) [](https://apify.github.io/impit/js/modules.html#remoteprotocolerror) [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) [](https://apify.github.io/impit/js/modules.html#requesterror) [RequestNotRead](https://apify.github.io/impit/js/classes/RequestNotRead.html) [](https://apify.github.io/impit/js/modules.html#requestnotread) [ResponseNotRead](https://apify.github.io/impit/js/classes/ResponseNotRead.html) [](https://apify.github.io/impit/js/modules.html#responsenotread) [StreamClosed](https://apify.github.io/impit/js/classes/StreamClosed.html) [](https://apify.github.io/impit/js/modules.html#streamclosed) [StreamConsumed](https://apify.github.io/impit/js/classes/StreamConsumed.html) [](https://apify.github.io/impit/js/modules.html#streamconsumed) [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) [](https://apify.github.io/impit/js/modules.html#streamerror) [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) [](https://apify.github.io/impit/js/modules.html#timeouterror) [TooManyRedirects](https://apify.github.io/impit/js/classes/TooManyRedirects.html) [](https://apify.github.io/impit/js/modules.html#toomanyredirects) [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) [](https://apify.github.io/impit/js/modules.html#transporterror) [UnsupportedProtocol](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html) [](https://apify.github.io/impit/js/modules.html#unsupportedprotocol) [WriteError](https://apify.github.io/impit/js/classes/WriteError.html) [](https://apify.github.io/impit/js/modules.html#writeerror) [WriteTimeout](https://apify.github.io/impit/js/classes/WriteTimeout.html) [](https://apify.github.io/impit/js/modules.html#writetimeout) Interfaces ---------- [ImpitOptions](https://apify.github.io/impit/js/interfaces/ImpitOptions.html) [](https://apify.github.io/impit/js/modules.html#impitoptions) [RequestInit](https://apify.github.io/impit/js/interfaces/RequestInit.html) [](https://apify.github.io/impit/js/modules.html#requestinit) Type Aliases ------------ [Browser](https://apify.github.io/impit/js/types/Browser.html) [](https://apify.github.io/impit/js/modules.html#browser) [HttpMethod](https://apify.github.io/impit/js/types/HttpMethod.html) [](https://apify.github.io/impit/js/modules.html#httpmethod) [ImpitWrapper](https://apify.github.io/impit/js/types/ImpitWrapper.html) [](https://apify.github.io/impit/js/modules.html#impitwrapper) [TypedArray](https://apify.github.io/impit/js/types/TypedArray.html) [](https://apify.github.io/impit/js/modules.html#typedarray) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Classes [CloseError](https://apify.github.io/impit/js/modules.html#closeerror) [ConnectError](https://apify.github.io/impit/js/modules.html#connecterror) [ConnectTimeout](https://apify.github.io/impit/js/modules.html#connecttimeout) [CookieConflict](https://apify.github.io/impit/js/modules.html#cookieconflict) [DecodingError](https://apify.github.io/impit/js/modules.html#decodingerror) [HTTPError](https://apify.github.io/impit/js/modules.html#httperror) [HTTPStatusError](https://apify.github.io/impit/js/modules.html#httpstatuserror) [Impit](https://apify.github.io/impit/js/modules.html#impit) [ImpitError](https://apify.github.io/impit/js/modules.html#impiterror) [ImpitResponse](https://apify.github.io/impit/js/modules.html#impitresponse) [InvalidURL](https://apify.github.io/impit/js/modules.html#invalidurl) [LocalProtocolError](https://apify.github.io/impit/js/modules.html#localprotocolerror) [NetworkError](https://apify.github.io/impit/js/modules.html#networkerror) [PoolTimeout](https://apify.github.io/impit/js/modules.html#pooltimeout) [ProtocolError](https://apify.github.io/impit/js/modules.html#protocolerror) [ProxyAuthRequired](https://apify.github.io/impit/js/modules.html#proxyauthrequired) [ProxyError](https://apify.github.io/impit/js/modules.html#proxyerror) [ProxyTunnelError](https://apify.github.io/impit/js/modules.html#proxytunnelerror) [ReadError](https://apify.github.io/impit/js/modules.html#readerror) [ReadTimeout](https://apify.github.io/impit/js/modules.html#readtimeout) [RemoteProtocolError](https://apify.github.io/impit/js/modules.html#remoteprotocolerror) [RequestError](https://apify.github.io/impit/js/modules.html#requesterror) [RequestNotRead](https://apify.github.io/impit/js/modules.html#requestnotread) [ResponseNotRead](https://apify.github.io/impit/js/modules.html#responsenotread) [StreamClosed](https://apify.github.io/impit/js/modules.html#streamclosed) [StreamConsumed](https://apify.github.io/impit/js/modules.html#streamconsumed) [StreamError](https://apify.github.io/impit/js/modules.html#streamerror) [TimeoutError](https://apify.github.io/impit/js/modules.html#timeouterror) [TooManyRedirects](https://apify.github.io/impit/js/modules.html#toomanyredirects) [TransportError](https://apify.github.io/impit/js/modules.html#transporterror) [UnsupportedProtocol](https://apify.github.io/impit/js/modules.html#unsupportedprotocol) [WriteError](https://apify.github.io/impit/js/modules.html#writeerror) [WriteTimeout](https://apify.github.io/impit/js/modules.html#writetimeout) Interfaces [ImpitOptions](https://apify.github.io/impit/js/modules.html#impitoptions) [RequestInit](https://apify.github.io/impit/js/modules.html#requestinit) Type Aliases [Browser](https://apify.github.io/impit/js/modules.html#browser) [HttpMethod](https://apify.github.io/impit/js/modules.html#httpmethod) [ImpitWrapper](https://apify.github.io/impit/js/modules.html#impitwrapper) [TypedArray](https://apify.github.io/impit/js/modules.html#typedarray) MMNEPVFCICPMFPCPTTAAATR --- # ConnectError | impit * [ConnectError](https://apify.github.io/impit/js/classes/ConnectError.html) Class ConnectError ================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ConnectError) , Expand) * [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) * ConnectError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ConnectError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ConnectError.html#message) [name](https://apify.github.io/impit/js/classes/ConnectError.html#name) [stack?](https://apify.github.io/impit/js/classes/ConnectError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ConnectError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ConnectError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ConnectError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ConnectError.html#constructor) * new ConnectError(message?: string): [ConnectError](https://apify.github.io/impit/js/classes/ConnectError.html) [](https://apify.github.io/impit/js/classes/ConnectError.html#constructorconnecterror) #### Parameters * `Optional`message: string #### Returns [ConnectError](https://apify.github.io/impit/js/classes/ConnectError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ConnectError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ConnectError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ConnectError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ConnectError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ConnectError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ConnectError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ConnectError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ConnectError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ConnectError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ConnectError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ConnectError.html#message) [name](https://apify.github.io/impit/js/classes/ConnectError.html#name) [stack](https://apify.github.io/impit/js/classes/ConnectError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ConnectError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ConnectError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ConnectError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # CloseError | impit * [CloseError](https://apify.github.io/impit/js/classes/CloseError.html) Class CloseError ================ #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#CloseError) , Expand) * [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) * CloseError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/CloseError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/CloseError.html#message) [name](https://apify.github.io/impit/js/classes/CloseError.html#name) [stack?](https://apify.github.io/impit/js/classes/CloseError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/CloseError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/CloseError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/CloseError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/CloseError.html#constructor) * new CloseError(message?: string): [CloseError](https://apify.github.io/impit/js/classes/CloseError.html) [](https://apify.github.io/impit/js/classes/CloseError.html#constructorcloseerror) #### Parameters * `Optional`message: string #### Returns [CloseError](https://apify.github.io/impit/js/classes/CloseError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/CloseError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/CloseError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/CloseError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/CloseError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/CloseError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/CloseError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/CloseError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/CloseError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/CloseError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/CloseError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/CloseError.html#message) [name](https://apify.github.io/impit/js/classes/CloseError.html#name) [stack](https://apify.github.io/impit/js/classes/CloseError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/CloseError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/CloseError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/CloseError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ConnectTimeout | impit * [ConnectTimeout](https://apify.github.io/impit/js/classes/ConnectTimeout.html) Class ConnectTimeout ==================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ConnectTimeout) , Expand) * [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) * ConnectTimeout ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ConnectTimeout.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ConnectTimeout.html#message) [name](https://apify.github.io/impit/js/classes/ConnectTimeout.html#name) [stack?](https://apify.github.io/impit/js/classes/ConnectTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ConnectTimeout.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ConnectTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ConnectTimeout.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#constructor) * new ConnectTimeout(message?: string): [ConnectTimeout](https://apify.github.io/impit/js/classes/ConnectTimeout.html) [](https://apify.github.io/impit/js/classes/ConnectTimeout.html#constructorconnecttimeout) #### Parameters * `Optional`message: string #### Returns [ConnectTimeout](https://apify.github.io/impit/js/classes/ConnectTimeout.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ConnectTimeout.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ConnectTimeout.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ConnectTimeout.html#message) [name](https://apify.github.io/impit/js/classes/ConnectTimeout.html#name) [stack](https://apify.github.io/impit/js/classes/ConnectTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ConnectTimeout.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ConnectTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ConnectTimeout.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # CookieConflict | impit * [CookieConflict](https://apify.github.io/impit/js/classes/CookieConflict.html) Class CookieConflict ==================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#CookieConflict) , Expand) * [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) * CookieConflict ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/CookieConflict.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/CookieConflict.html#message) [name](https://apify.github.io/impit/js/classes/CookieConflict.html#name) [stack?](https://apify.github.io/impit/js/classes/CookieConflict.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/CookieConflict.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/CookieConflict.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/CookieConflict.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/CookieConflict.html#constructor) * new CookieConflict(message?: string): [CookieConflict](https://apify.github.io/impit/js/classes/CookieConflict.html) [](https://apify.github.io/impit/js/classes/CookieConflict.html#constructorcookieconflict) #### Parameters * `Optional`message: string #### Returns [CookieConflict](https://apify.github.io/impit/js/classes/CookieConflict.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/CookieConflict.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/CookieConflict.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/CookieConflict.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/CookieConflict.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/CookieConflict.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/CookieConflict.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/CookieConflict.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/CookieConflict.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/CookieConflict.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/CookieConflict.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/CookieConflict.html#message) [name](https://apify.github.io/impit/js/classes/CookieConflict.html#name) [stack](https://apify.github.io/impit/js/classes/CookieConflict.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/CookieConflict.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/CookieConflict.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/CookieConflict.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # impit documentation Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode [Skip to content](https://apify.github.io/impit/python/#furo-main-content) [Back to top](https://apify.github.io/impit/python/#) [View this page](https://apify.github.io/impit/python/_sources/index.rst.txt "View this page") impit for Python[¶](https://apify.github.io/impit/python/#impit-for-python "Link to this heading") =================================================================================================== * [AsyncClient](https://apify.github.io/impit/python/api/async-client.html) * [Client](https://apify.github.io/impit/python/api/client.html) * [Response](https://apify.github.io/impit/python/api/response.html) README[¶](https://apify.github.io/impit/python/#readme "Link to this heading") =============================================================================== `impit` for Python[¶](https://apify.github.io/impit/python/#id1 "Link to this heading") ---------------------------------------------------------------------------------------- > This documents the `impit` Python package, which provides bindings for the `impit` library. > > See documentation for the JavaScript/TypeScript version of `impit` [here](https://apify.github.io/impit/js/) > . `impit` is a Python package that provides bindings for the [`impit`](https://github.com/apify/impit) library. It allows you to switch the TLS fingerprints and the HTTP headers of your requests, while still using the same API as `httpx` or `requests`. ### Installation[¶](https://apify.github.io/impit/python/#installation "Link to this heading") pip install impit #### Compatibility[¶](https://apify.github.io/impit/python/#compatibility "Link to this heading") | Operating System | Architecture | libc implementation | Prebuilt wheels available on PyPI | | --- | --- | --- | --- | | Linux | x86\_64 | glibc | ✅ | | Linux | x86\_64 | musl | ✅ | | macOS | x86\_64 | N/A | ✅ | | Windows | x86\_64 | N/A | ✅ | | macOS | arm64 | N/A | ✅ | | Windows | arm64 | N/A | ✅ | | Linux | arm64 | musl | ✅ | | Linux | arm64 | glibc | ❌\* | \*The prebuilt binaries for Linux on arm64 with `glibc` are WIP and not available as prebuilt wheels on PyPI yet. You can build the package from sources in this repository. ### Usage[¶](https://apify.github.io/impit/python/#usage "Link to this heading") import asyncio from impit import AsyncClient async def main(): impit \= AsyncClient(http3\=True, browser\='firefox') response \= await impit.get( "https://example.com", ); print(response.status\_code) print(response.text) print(response.http\_version) asyncio.run(main()) Impit implements the HTTPX client interface, so you can use it as a drop-in replacement for `httpx.AsyncClient`. Note that the implementation is partial and some features may not be supported yet. --- # DecodingError | impit * [DecodingError](https://apify.github.io/impit/js/classes/DecodingError.html) Class DecodingError =================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#DecodingError) , Expand) * [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) * DecodingError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/DecodingError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/DecodingError.html#message) [name](https://apify.github.io/impit/js/classes/DecodingError.html#name) [stack?](https://apify.github.io/impit/js/classes/DecodingError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/DecodingError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/DecodingError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/DecodingError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/DecodingError.html#constructor) * new DecodingError(message?: string): [DecodingError](https://apify.github.io/impit/js/classes/DecodingError.html) [](https://apify.github.io/impit/js/classes/DecodingError.html#constructordecodingerror) #### Parameters * `Optional`message: string #### Returns [DecodingError](https://apify.github.io/impit/js/classes/DecodingError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/DecodingError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/DecodingError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/DecodingError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/DecodingError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/DecodingError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/DecodingError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/DecodingError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/DecodingError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/DecodingError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/DecodingError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/DecodingError.html#message) [name](https://apify.github.io/impit/js/classes/DecodingError.html#name) [stack](https://apify.github.io/impit/js/classes/DecodingError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/DecodingError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/DecodingError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/DecodingError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # HTTPError | impit * [HTTPError](https://apify.github.io/impit/js/classes/HTTPError.html) Class HTTPError =============== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#HTTPError) , Expand) * [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) * HTTPError * [HTTPStatusError](https://apify.github.io/impit/js/classes/HTTPStatusError.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/HTTPError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/HTTPError.html#message) [name](https://apify.github.io/impit/js/classes/HTTPError.html#name) [stack?](https://apify.github.io/impit/js/classes/HTTPError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/HTTPError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/HTTPError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/HTTPError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/HTTPError.html#constructor) * new HTTPError(message?: string): [HTTPError](https://apify.github.io/impit/js/classes/HTTPError.html) [](https://apify.github.io/impit/js/classes/HTTPError.html#constructorhttperror) #### Parameters * `Optional`message: string #### Returns [HTTPError](https://apify.github.io/impit/js/classes/HTTPError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/HTTPError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/HTTPError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/HTTPError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/HTTPError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/HTTPError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/HTTPError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/HTTPError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/HTTPError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/HTTPError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/HTTPError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/HTTPError.html#message) [name](https://apify.github.io/impit/js/classes/HTTPError.html#name) [stack](https://apify.github.io/impit/js/classes/HTTPError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/HTTPError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/HTTPError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/HTTPError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # Impit | impit * [Impit](https://apify.github.io/impit/js/classes/Impit.html) Class Impit =========== The main class of the `impit` package This class is the primary interface for making HTTP requests. It provides methods to configure the Impit instance and to perform requests. #### Example[](https://apify.github.io/impit/js/classes/Impit.html#example) import { Impit } from 'impit';const impit = new Impit();const response = await impit.fetch('https://example.com');console.log(await response.text()); One `Impit` instance represents a single (possibly impersonated) user agent. Note that all the requests made by this instance will share the same configuration, resources (e.g. cookie jar and connection pool), and other settings. ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/Impit.html#constructor) ### Methods [fetch](https://apify.github.io/impit/js/classes/Impit.html#fetch) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/Impit.html#constructor) * new Impit(options?: [ImpitOptions](https://apify.github.io/impit/js/interfaces/ImpitOptions.html) ): [Impit](https://apify.github.io/impit/js/classes/Impit.html) [](https://apify.github.io/impit/js/classes/Impit.html#constructorimpit) Creates a new `Impit` instance with the given options. The `options` parameter allows you to customize the behavior of the Impit instance. If no options are provided, default settings will be used. #### Parameters * `Optional`options: [ImpitOptions](https://apify.github.io/impit/js/interfaces/ImpitOptions.html) #### Returns [Impit](https://apify.github.io/impit/js/classes/Impit.html) #### Example[](https://apify.github.io/impit/js/classes/Impit.html#example-1) import { Impit } from 'impit';const impit = new Impit({ timeout: 5e3, // Set a default timeout of 5000 headers: { 'Authorization: 'Bearer ', }, browser: 'chrome',}); Methods ------- ### fetch[](https://apify.github.io/impit/js/classes/Impit.html#fetch) * fetch(     resource: string | [Request](https://developer.mozilla.org/docs/Web/API/Request) | [URL](https://developer.mozilla.org/docs/Web/API/URL) ,     init?: [RequestInit](https://apify.github.io/impit/js/interfaces/RequestInit.html) , ): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[ImpitResponse](https://apify.github.io/impit/js/classes/ImpitResponse.html) \>[](https://apify.github.io/impit/js/classes/Impit.html#fetch-1) Fetch a URL with the given options. This method performs an HTTP request to the specified URL using the provided options. It returns a promise that resolves to an [ImpitResponse](https://apify.github.io/impit/js/classes/ImpitResponse.html) object containing the response data. This method is designed to be API-compatible with the [Fetch API `fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch) global method. #### Parameters * resource: string | [Request](https://developer.mozilla.org/docs/Web/API/Request) | [URL](https://developer.mozilla.org/docs/Web/API/URL) * `Optional`init: [RequestInit](https://apify.github.io/impit/js/interfaces/RequestInit.html) #### Returns [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[ImpitResponse](https://apify.github.io/impit/js/classes/ImpitResponse.html) \> #### Example[](https://apify.github.io/impit/js/classes/Impit.html#example-2) import { Impit } from 'impit';const impit = new Impit();const response = await impit.fetch('https://example.com', { method: 'GET', headers: { 'Accept': 'application/json' }, timeout: 5e3,}); ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/Impit.html#constructor) Methods [fetch](https://apify.github.io/impit/js/classes/Impit.html#fetch) MMNEPVFCICPMFPCPTTAAATR --- # ImpitError | impit * [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) Class ImpitError ================ #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ImpitError) , Expand) * [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * ImpitError * [HTTPError](https://apify.github.io/impit/js/classes/HTTPError.html) * [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) * [InvalidURL](https://apify.github.io/impit/js/classes/InvalidURL.html) * [CookieConflict](https://apify.github.io/impit/js/classes/CookieConflict.html) * [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ImpitError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ImpitError.html#message) [name](https://apify.github.io/impit/js/classes/ImpitError.html#name) [stack?](https://apify.github.io/impit/js/classes/ImpitError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ImpitError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ImpitError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ImpitError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ImpitError.html#constructor) * new ImpitError(message?: string): [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) [](https://apify.github.io/impit/js/classes/ImpitError.html#constructorimpiterror) #### Parameters * `Optional`message: string #### Returns [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ImpitError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ImpitError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ImpitError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ImpitError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ImpitError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ImpitError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ImpitError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ImpitError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ImpitError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ImpitError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ImpitError.html#message) [name](https://apify.github.io/impit/js/classes/ImpitError.html#name) [stack](https://apify.github.io/impit/js/classes/ImpitError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ImpitError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ImpitError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ImpitError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ImpitResponse | impit * [ImpitResponse](https://apify.github.io/impit/js/classes/ImpitResponse.html) Class ImpitResponse =================== Represents an HTTP response. The `ImpitResponse` class provides access to the response status, headers, and body. It also includes methods to read the response body in various formats such as text, JSON, ArrayBuffer, and as a stream. This class is designed to be API-compatible with the [Fetch API Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) class. ##### Index ### Properties [headers](https://apify.github.io/impit/js/classes/ImpitResponse.html#headers) [ok](https://apify.github.io/impit/js/classes/ImpitResponse.html#ok) [status](https://apify.github.io/impit/js/classes/ImpitResponse.html#status) [statusText](https://apify.github.io/impit/js/classes/ImpitResponse.html#statustext) [url](https://apify.github.io/impit/js/classes/ImpitResponse.html#url) ### Accessors [body](https://apify.github.io/impit/js/classes/ImpitResponse.html#body) ### Methods [abort](https://apify.github.io/impit/js/classes/ImpitResponse.html#abort) [arrayBuffer](https://apify.github.io/impit/js/classes/ImpitResponse.html#arraybuffer) [bytes](https://apify.github.io/impit/js/classes/ImpitResponse.html#bytes) [json](https://apify.github.io/impit/js/classes/ImpitResponse.html#json) [text](https://apify.github.io/impit/js/classes/ImpitResponse.html#text) Properties ---------- ### headers[](https://apify.github.io/impit/js/classes/ImpitResponse.html#headers) headers: [Headers](https://developer.mozilla.org/docs/Web/API/Headers) HTTP headers of the response. An instance of the [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) class. ### ok[](https://apify.github.io/impit/js/classes/ImpitResponse.html#ok) ok: boolean `true` if the response status code is in the range 200-299. ### status[](https://apify.github.io/impit/js/classes/ImpitResponse.html#status) status: number HTTP status code of the response. Example: `200` for a successful response. ### statusText[](https://apify.github.io/impit/js/classes/ImpitResponse.html#statustext) statusText: string Status text of the response. A short description of the status code. Example: "OK" for status code 200. ### url[](https://apify.github.io/impit/js/classes/ImpitResponse.html#url) url: string URL of the response. In case of redirects, this will be the final URL after all redirects have been followed. Accessors --------- ### body[](https://apify.github.io/impit/js/classes/ImpitResponse.html#body) * get body(): [ReadableStream](https://developer.mozilla.org/docs/Web/API/ReadableStream) <[Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) \> Returns the response body as a `ReadableStream`. This property provides access to the response body as a stream of data, allowing you to read it in chunks. #### Returns [ReadableStream](https://developer.mozilla.org/docs/Web/API/ReadableStream) <[Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) \> #### Example[](https://apify.github.io/impit/js/classes/ImpitResponse.html#example) const response = await impit.fetch('https://example.com');const reader = response.body.getReader();let result;while (!(result = await reader.read()).done) { console.log(result.value); // Uint8Array chunk} Methods ------- ### abort[](https://apify.github.io/impit/js/classes/ImpitResponse.html#abort) * abort(): void[](https://apify.github.io/impit/js/classes/ImpitResponse.html#abort-1) Aborts the response. This API is called internally and can change without notice. Use `fetch(url, { signal: AbortSignal })` to abort a request instead. #### Returns void ### arrayBuffer[](https://apify.github.io/impit/js/classes/ImpitResponse.html#arraybuffer) * arrayBuffer(): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[ArrayBuffer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \>[](https://apify.github.io/impit/js/classes/ImpitResponse.html#arraybuffer-1) Returns the response body as an `ArrayBuffer`. This method is asynchronous and returns a promise that resolves to an `ArrayBuffer` containing the response body data. #### Returns [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[ArrayBuffer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \> #### Example[](https://apify.github.io/impit/js/classes/ImpitResponse.html#example-1) const response = await impit.fetch('https://example.com');const arrayBuffer = await response.arrayBuffer();console.log(arrayBuffer); // ArrayBuffer([ 0x3c, 0x68, 0x74, 0x6d, 0x6c, ... ]) Note that you cannot call this method multiple times on the same response instance, as the response body can only be consumed once. Subsequent calls will result in an error. ### bytes[](https://apify.github.io/impit/js/classes/ImpitResponse.html#bytes) * bytes(): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) \>[](https://apify.github.io/impit/js/classes/ImpitResponse.html#bytes-1) Returns the response body as a `Uint8Array`. This method is asynchronous and returns a promise that resolves to a `Uint8Array` containing the response body data. #### Returns [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) \> #### Example[](https://apify.github.io/impit/js/classes/ImpitResponse.html#example-2) const response = await impit.fetch('https://example.com');const uint8Array = await response.bytes();console.log(uint8Array); // Uint8Array([ 0x3c, 0x68, 0x74, 0x6d, 0x6c, ... ]) Note that you cannot call this method multiple times on the same response instance, as the response body can only be consumed once. Subsequent calls will result in an error. ### json[](https://apify.github.io/impit/js/classes/ImpitResponse.html#json) * json(): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) [](https://apify.github.io/impit/js/classes/ImpitResponse.html#json-1) Parses the response body as JSON. This method is asynchronous and returns a promise that resolves to the parsed JSON object. #### Returns [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) #### Example[](https://apify.github.io/impit/js/classes/ImpitResponse.html#example-3) const response = await impit.fetch('https://api.example.com/data');const data = await response.json();console.log(data); // Parsed JSON object ### text[](https://apify.github.io/impit/js/classes/ImpitResponse.html#text) * text(): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) [](https://apify.github.io/impit/js/classes/ImpitResponse.html#text-1) Returns the response body as a string. This method is asynchronous and returns a promise that resolves to a string containing the response body data. #### Returns [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) #### Example[](https://apify.github.io/impit/js/classes/ImpitResponse.html#example-4) const response = await impit.fetch('https://example.com');const text = await response.text();console.log(text); // "..." ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Properties [headers](https://apify.github.io/impit/js/classes/ImpitResponse.html#headers) [ok](https://apify.github.io/impit/js/classes/ImpitResponse.html#ok) [status](https://apify.github.io/impit/js/classes/ImpitResponse.html#status) [statusText](https://apify.github.io/impit/js/classes/ImpitResponse.html#statustext) [url](https://apify.github.io/impit/js/classes/ImpitResponse.html#url) Accessors [body](https://apify.github.io/impit/js/classes/ImpitResponse.html#body) Methods [abort](https://apify.github.io/impit/js/classes/ImpitResponse.html#abort) [arrayBuffer](https://apify.github.io/impit/js/classes/ImpitResponse.html#arraybuffer) [bytes](https://apify.github.io/impit/js/classes/ImpitResponse.html#bytes) [json](https://apify.github.io/impit/js/classes/ImpitResponse.html#json) [text](https://apify.github.io/impit/js/classes/ImpitResponse.html#text) MMNEPVFCICPMFPCPTTAAATR --- # LocalProtocolError | impit * [LocalProtocolError](https://apify.github.io/impit/js/classes/LocalProtocolError.html) Class LocalProtocolError ======================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#LocalProtocolError) , Expand) * [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) * LocalProtocolError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/LocalProtocolError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/LocalProtocolError.html#message) [name](https://apify.github.io/impit/js/classes/LocalProtocolError.html#name) [stack?](https://apify.github.io/impit/js/classes/LocalProtocolError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/LocalProtocolError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/LocalProtocolError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/LocalProtocolError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#constructor) * new LocalProtocolError(message?: string): [LocalProtocolError](https://apify.github.io/impit/js/classes/LocalProtocolError.html) [](https://apify.github.io/impit/js/classes/LocalProtocolError.html#constructorlocalprotocolerror) #### Parameters * `Optional`message: string #### Returns [LocalProtocolError](https://apify.github.io/impit/js/classes/LocalProtocolError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/LocalProtocolError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/LocalProtocolError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/LocalProtocolError.html#message) [name](https://apify.github.io/impit/js/classes/LocalProtocolError.html#name) [stack](https://apify.github.io/impit/js/classes/LocalProtocolError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/LocalProtocolError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/LocalProtocolError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/LocalProtocolError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # InvalidURL | impit * [InvalidURL](https://apify.github.io/impit/js/classes/InvalidURL.html) Class InvalidURL ================ #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#InvalidURL) , Expand) * [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) * InvalidURL ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/InvalidURL.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/InvalidURL.html#message) [name](https://apify.github.io/impit/js/classes/InvalidURL.html#name) [stack?](https://apify.github.io/impit/js/classes/InvalidURL.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/InvalidURL.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/InvalidURL.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/InvalidURL.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/InvalidURL.html#constructor) * new InvalidURL(message?: string): [InvalidURL](https://apify.github.io/impit/js/classes/InvalidURL.html) [](https://apify.github.io/impit/js/classes/InvalidURL.html#constructorinvalidurl) #### Parameters * `Optional`message: string #### Returns [InvalidURL](https://apify.github.io/impit/js/classes/InvalidURL.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/InvalidURL.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/InvalidURL.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/InvalidURL.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/InvalidURL.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/InvalidURL.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/InvalidURL.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/InvalidURL.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/InvalidURL.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/InvalidURL.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/InvalidURL.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/InvalidURL.html#message) [name](https://apify.github.io/impit/js/classes/InvalidURL.html#name) [stack](https://apify.github.io/impit/js/classes/InvalidURL.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/InvalidURL.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/InvalidURL.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/InvalidURL.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # NetworkError | impit * [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) Class NetworkError ================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#NetworkError) , Expand) * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) * NetworkError * [ConnectError](https://apify.github.io/impit/js/classes/ConnectError.html) * [ReadError](https://apify.github.io/impit/js/classes/ReadError.html) * [WriteError](https://apify.github.io/impit/js/classes/WriteError.html) * [CloseError](https://apify.github.io/impit/js/classes/CloseError.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/NetworkError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/NetworkError.html#message) [name](https://apify.github.io/impit/js/classes/NetworkError.html#name) [stack?](https://apify.github.io/impit/js/classes/NetworkError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/NetworkError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/NetworkError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/NetworkError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/NetworkError.html#constructor) * new NetworkError(message?: string): [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) [](https://apify.github.io/impit/js/classes/NetworkError.html#constructornetworkerror) #### Parameters * `Optional`message: string #### Returns [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/NetworkError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/NetworkError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/NetworkError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/NetworkError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/NetworkError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/NetworkError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/NetworkError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/NetworkError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/NetworkError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/NetworkError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/NetworkError.html#message) [name](https://apify.github.io/impit/js/classes/NetworkError.html#name) [stack](https://apify.github.io/impit/js/classes/NetworkError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/NetworkError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/NetworkError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/NetworkError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # PoolTimeout | impit * [PoolTimeout](https://apify.github.io/impit/js/classes/PoolTimeout.html) Class PoolTimeout ================= #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#PoolTimeout) , Expand) * [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) * PoolTimeout ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/PoolTimeout.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/PoolTimeout.html#message) [name](https://apify.github.io/impit/js/classes/PoolTimeout.html#name) [stack?](https://apify.github.io/impit/js/classes/PoolTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/PoolTimeout.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/PoolTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/PoolTimeout.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/PoolTimeout.html#constructor) * new PoolTimeout(message?: string): [PoolTimeout](https://apify.github.io/impit/js/classes/PoolTimeout.html) [](https://apify.github.io/impit/js/classes/PoolTimeout.html#constructorpooltimeout) #### Parameters * `Optional`message: string #### Returns [PoolTimeout](https://apify.github.io/impit/js/classes/PoolTimeout.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/PoolTimeout.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/PoolTimeout.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/PoolTimeout.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/PoolTimeout.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/PoolTimeout.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/PoolTimeout.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/PoolTimeout.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/PoolTimeout.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/PoolTimeout.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/PoolTimeout.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/PoolTimeout.html#message) [name](https://apify.github.io/impit/js/classes/PoolTimeout.html#name) [stack](https://apify.github.io/impit/js/classes/PoolTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/PoolTimeout.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/PoolTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/PoolTimeout.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ProxyAuthRequired | impit * [ProxyAuthRequired](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html) Class ProxyAuthRequired ======================= #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ProxyAuthRequired) , Expand) * [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) * ProxyAuthRequired ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#message) [name](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#name) [stack?](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#constructor) * new ProxyAuthRequired(message?: string): [ProxyAuthRequired](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html) [](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#constructorproxyauthrequired) #### Parameters * `Optional`message: string #### Returns [ProxyAuthRequired](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#message) [name](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#name) [stack](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ProxyError | impit * [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) Class ProxyError ================ #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ProxyError) , Expand) * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) * ProxyError * [ProxyTunnelError](https://apify.github.io/impit/js/classes/ProxyTunnelError.html) * [ProxyAuthRequired](https://apify.github.io/impit/js/classes/ProxyAuthRequired.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ProxyError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ProxyError.html#message) [name](https://apify.github.io/impit/js/classes/ProxyError.html#name) [stack?](https://apify.github.io/impit/js/classes/ProxyError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProxyError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProxyError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProxyError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ProxyError.html#constructor) * new ProxyError(message?: string): [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) [](https://apify.github.io/impit/js/classes/ProxyError.html#constructorproxyerror) #### Parameters * `Optional`message: string #### Returns [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ProxyError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ProxyError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ProxyError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ProxyError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ProxyError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ProxyError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ProxyError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ProxyError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ProxyError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ProxyError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ProxyError.html#message) [name](https://apify.github.io/impit/js/classes/ProxyError.html#name) [stack](https://apify.github.io/impit/js/classes/ProxyError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProxyError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProxyError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProxyError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ProtocolError | impit * [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) Class ProtocolError =================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ProtocolError) , Expand) * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) * ProtocolError * [LocalProtocolError](https://apify.github.io/impit/js/classes/LocalProtocolError.html) * [RemoteProtocolError](https://apify.github.io/impit/js/classes/RemoteProtocolError.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ProtocolError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ProtocolError.html#message) [name](https://apify.github.io/impit/js/classes/ProtocolError.html#name) [stack?](https://apify.github.io/impit/js/classes/ProtocolError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProtocolError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProtocolError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProtocolError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ProtocolError.html#constructor) * new ProtocolError(message?: string): [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) [](https://apify.github.io/impit/js/classes/ProtocolError.html#constructorprotocolerror) #### Parameters * `Optional`message: string #### Returns [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ProtocolError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ProtocolError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ProtocolError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ProtocolError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ProtocolError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ProtocolError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ProtocolError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ProtocolError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ProtocolError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ProtocolError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ProtocolError.html#message) [name](https://apify.github.io/impit/js/classes/ProtocolError.html#name) [stack](https://apify.github.io/impit/js/classes/ProtocolError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProtocolError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProtocolError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProtocolError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ReadError | impit * [ReadError](https://apify.github.io/impit/js/classes/ReadError.html) Class ReadError =============== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ReadError) , Expand) * [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) * ReadError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ReadError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ReadError.html#message) [name](https://apify.github.io/impit/js/classes/ReadError.html#name) [stack?](https://apify.github.io/impit/js/classes/ReadError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ReadError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ReadError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ReadError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ReadError.html#constructor) * new ReadError(message?: string): [ReadError](https://apify.github.io/impit/js/classes/ReadError.html) [](https://apify.github.io/impit/js/classes/ReadError.html#constructorreaderror) #### Parameters * `Optional`message: string #### Returns [ReadError](https://apify.github.io/impit/js/classes/ReadError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ReadError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ReadError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ReadError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ReadError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ReadError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ReadError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ReadError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ReadError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ReadError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ReadError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ReadError.html#message) [name](https://apify.github.io/impit/js/classes/ReadError.html#name) [stack](https://apify.github.io/impit/js/classes/ReadError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ReadError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ReadError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ReadError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # HTTPStatusError | impit * [HTTPStatusError](https://apify.github.io/impit/js/classes/HTTPStatusError.html) Class HTTPStatusError ===================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#HTTPStatusError) , Expand) * [HTTPError](https://apify.github.io/impit/js/classes/HTTPError.html) * HTTPStatusError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/HTTPStatusError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/HTTPStatusError.html#message) [name](https://apify.github.io/impit/js/classes/HTTPStatusError.html#name) [stack?](https://apify.github.io/impit/js/classes/HTTPStatusError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/HTTPStatusError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/HTTPStatusError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/HTTPStatusError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#constructor) * new HTTPStatusError(message?: string): [HTTPStatusError](https://apify.github.io/impit/js/classes/HTTPStatusError.html) [](https://apify.github.io/impit/js/classes/HTTPStatusError.html#constructorhttpstatuserror) #### Parameters * `Optional`message: string #### Returns [HTTPStatusError](https://apify.github.io/impit/js/classes/HTTPStatusError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/HTTPStatusError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/HTTPStatusError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/HTTPStatusError.html#message) [name](https://apify.github.io/impit/js/classes/HTTPStatusError.html#name) [stack](https://apify.github.io/impit/js/classes/HTTPStatusError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/HTTPStatusError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/HTTPStatusError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/HTTPStatusError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ReadTimeout | impit * [ReadTimeout](https://apify.github.io/impit/js/classes/ReadTimeout.html) Class ReadTimeout ================= #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ReadTimeout) , Expand) * [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) * ReadTimeout ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ReadTimeout.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ReadTimeout.html#message) [name](https://apify.github.io/impit/js/classes/ReadTimeout.html#name) [stack?](https://apify.github.io/impit/js/classes/ReadTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ReadTimeout.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ReadTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ReadTimeout.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ReadTimeout.html#constructor) * new ReadTimeout(message?: string): [ReadTimeout](https://apify.github.io/impit/js/classes/ReadTimeout.html) [](https://apify.github.io/impit/js/classes/ReadTimeout.html#constructorreadtimeout) #### Parameters * `Optional`message: string #### Returns [ReadTimeout](https://apify.github.io/impit/js/classes/ReadTimeout.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ReadTimeout.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ReadTimeout.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ReadTimeout.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ReadTimeout.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ReadTimeout.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ReadTimeout.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ReadTimeout.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ReadTimeout.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ReadTimeout.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ReadTimeout.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ReadTimeout.html#message) [name](https://apify.github.io/impit/js/classes/ReadTimeout.html#name) [stack](https://apify.github.io/impit/js/classes/ReadTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ReadTimeout.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ReadTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ReadTimeout.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ProxyTunnelError | impit * [ProxyTunnelError](https://apify.github.io/impit/js/classes/ProxyTunnelError.html) Class ProxyTunnelError ====================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ProxyTunnelError) , Expand) * [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) * ProxyTunnelError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#message) [name](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#name) [stack?](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#stack) [status?](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#status) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#constructor) * new ProxyTunnelError(message?: string): [ProxyTunnelError](https://apify.github.io/impit/js/classes/ProxyTunnelError.html) [](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#constructorproxytunnelerror) #### Parameters * `Optional`message: string #### Returns [ProxyTunnelError](https://apify.github.io/impit/js/classes/ProxyTunnelError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#stack) stack?: string ### `Optional`status[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#status) status?: number ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#message) [name](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#name) [stack](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#stack) [status](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#status) [stackTraceLimit](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ProxyTunnelError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # RemoteProtocolError | impit * [RemoteProtocolError](https://apify.github.io/impit/js/classes/RemoteProtocolError.html) Class RemoteProtocolError ========================= #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#RemoteProtocolError) , Expand) * [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) * RemoteProtocolError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#message) [name](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#name) [stack?](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#constructor) * new RemoteProtocolError(message?: string): [RemoteProtocolError](https://apify.github.io/impit/js/classes/RemoteProtocolError.html) [](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#constructorremoteprotocolerror) #### Parameters * `Optional`message: string #### Returns [RemoteProtocolError](https://apify.github.io/impit/js/classes/RemoteProtocolError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#message) [name](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#name) [stack](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/RemoteProtocolError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # RequestError | impit * [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) Class RequestError ================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#RequestError) , Expand) * [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) * RequestError * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) * [DecodingError](https://apify.github.io/impit/js/classes/DecodingError.html) * [TooManyRedirects](https://apify.github.io/impit/js/classes/TooManyRedirects.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/RequestError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/RequestError.html#message) [name](https://apify.github.io/impit/js/classes/RequestError.html#name) [stack?](https://apify.github.io/impit/js/classes/RequestError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/RequestError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/RequestError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/RequestError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/RequestError.html#constructor) * new RequestError(message?: string): [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) [](https://apify.github.io/impit/js/classes/RequestError.html#constructorrequesterror) #### Parameters * `Optional`message: string #### Returns [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/RequestError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/RequestError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/RequestError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/RequestError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/RequestError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/RequestError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/RequestError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/RequestError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/RequestError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/RequestError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/RequestError.html#message) [name](https://apify.github.io/impit/js/classes/RequestError.html#name) [stack](https://apify.github.io/impit/js/classes/RequestError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/RequestError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/RequestError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/RequestError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # RequestNotRead | impit * [RequestNotRead](https://apify.github.io/impit/js/classes/RequestNotRead.html) Class RequestNotRead ==================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#RequestNotRead) , Expand) * [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) * RequestNotRead ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/RequestNotRead.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/RequestNotRead.html#message) [name](https://apify.github.io/impit/js/classes/RequestNotRead.html#name) [stack?](https://apify.github.io/impit/js/classes/RequestNotRead.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/RequestNotRead.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/RequestNotRead.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/RequestNotRead.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/RequestNotRead.html#constructor) * new RequestNotRead(message?: string): [RequestNotRead](https://apify.github.io/impit/js/classes/RequestNotRead.html) [](https://apify.github.io/impit/js/classes/RequestNotRead.html#constructorrequestnotread) #### Parameters * `Optional`message: string #### Returns [RequestNotRead](https://apify.github.io/impit/js/classes/RequestNotRead.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/RequestNotRead.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/RequestNotRead.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/RequestNotRead.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/RequestNotRead.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/RequestNotRead.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/RequestNotRead.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/RequestNotRead.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/RequestNotRead.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/RequestNotRead.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/RequestNotRead.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/RequestNotRead.html#message) [name](https://apify.github.io/impit/js/classes/RequestNotRead.html#name) [stack](https://apify.github.io/impit/js/classes/RequestNotRead.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/RequestNotRead.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/RequestNotRead.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/RequestNotRead.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # ResponseNotRead | impit * [ResponseNotRead](https://apify.github.io/impit/js/classes/ResponseNotRead.html) Class ResponseNotRead ===================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#ResponseNotRead) , Expand) * [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) * ResponseNotRead ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/ResponseNotRead.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/ResponseNotRead.html#message) [name](https://apify.github.io/impit/js/classes/ResponseNotRead.html#name) [stack?](https://apify.github.io/impit/js/classes/ResponseNotRead.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ResponseNotRead.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ResponseNotRead.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ResponseNotRead.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#constructor) * new ResponseNotRead(message?: string): [ResponseNotRead](https://apify.github.io/impit/js/classes/ResponseNotRead.html) [](https://apify.github.io/impit/js/classes/ResponseNotRead.html#constructorresponsenotread) #### Parameters * `Optional`message: string #### Returns [ResponseNotRead](https://apify.github.io/impit/js/classes/ResponseNotRead.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/ResponseNotRead.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/ResponseNotRead.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/ResponseNotRead.html#message) [name](https://apify.github.io/impit/js/classes/ResponseNotRead.html#name) [stack](https://apify.github.io/impit/js/classes/ResponseNotRead.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/ResponseNotRead.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/ResponseNotRead.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/ResponseNotRead.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # TimeoutError | impit * [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) Class TimeoutError ================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#TimeoutError) , Expand) * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) * TimeoutError * [ConnectTimeout](https://apify.github.io/impit/js/classes/ConnectTimeout.html) * [ReadTimeout](https://apify.github.io/impit/js/classes/ReadTimeout.html) * [WriteTimeout](https://apify.github.io/impit/js/classes/WriteTimeout.html) * [PoolTimeout](https://apify.github.io/impit/js/classes/PoolTimeout.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/TimeoutError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/TimeoutError.html#message) [name](https://apify.github.io/impit/js/classes/TimeoutError.html#name) [stack?](https://apify.github.io/impit/js/classes/TimeoutError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/TimeoutError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/TimeoutError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/TimeoutError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/TimeoutError.html#constructor) * new TimeoutError(message?: string): [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) [](https://apify.github.io/impit/js/classes/TimeoutError.html#constructortimeouterror) #### Parameters * `Optional`message: string #### Returns [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/TimeoutError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/TimeoutError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/TimeoutError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/TimeoutError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/TimeoutError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/TimeoutError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/TimeoutError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/TimeoutError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/TimeoutError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/TimeoutError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/TimeoutError.html#message) [name](https://apify.github.io/impit/js/classes/TimeoutError.html#name) [stack](https://apify.github.io/impit/js/classes/TimeoutError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/TimeoutError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/TimeoutError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/TimeoutError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # StreamConsumed | impit * [StreamConsumed](https://apify.github.io/impit/js/classes/StreamConsumed.html) Class StreamConsumed ==================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#StreamConsumed) , Expand) * [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) * StreamConsumed ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/StreamConsumed.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/StreamConsumed.html#message) [name](https://apify.github.io/impit/js/classes/StreamConsumed.html#name) [stack?](https://apify.github.io/impit/js/classes/StreamConsumed.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/StreamConsumed.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/StreamConsumed.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/StreamConsumed.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/StreamConsumed.html#constructor) * new StreamConsumed(message?: string): [StreamConsumed](https://apify.github.io/impit/js/classes/StreamConsumed.html) [](https://apify.github.io/impit/js/classes/StreamConsumed.html#constructorstreamconsumed) #### Parameters * `Optional`message: string #### Returns [StreamConsumed](https://apify.github.io/impit/js/classes/StreamConsumed.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/StreamConsumed.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/StreamConsumed.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/StreamConsumed.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/StreamConsumed.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/StreamConsumed.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/StreamConsumed.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/StreamConsumed.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/StreamConsumed.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/StreamConsumed.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/StreamConsumed.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/StreamConsumed.html#message) [name](https://apify.github.io/impit/js/classes/StreamConsumed.html#name) [stack](https://apify.github.io/impit/js/classes/StreamConsumed.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/StreamConsumed.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/StreamConsumed.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/StreamConsumed.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # StreamError | impit * [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) Class StreamError ================= #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#StreamError) , Expand) * [ImpitError](https://apify.github.io/impit/js/classes/ImpitError.html) * StreamError * [StreamConsumed](https://apify.github.io/impit/js/classes/StreamConsumed.html) * [ResponseNotRead](https://apify.github.io/impit/js/classes/ResponseNotRead.html) * [RequestNotRead](https://apify.github.io/impit/js/classes/RequestNotRead.html) * [StreamClosed](https://apify.github.io/impit/js/classes/StreamClosed.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/StreamError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/StreamError.html#message) [name](https://apify.github.io/impit/js/classes/StreamError.html#name) [stack?](https://apify.github.io/impit/js/classes/StreamError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/StreamError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/StreamError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/StreamError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/StreamError.html#constructor) * new StreamError(message?: string): [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) [](https://apify.github.io/impit/js/classes/StreamError.html#constructorstreamerror) #### Parameters * `Optional`message: string #### Returns [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/StreamError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/StreamError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/StreamError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/StreamError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/StreamError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/StreamError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/StreamError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/StreamError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/StreamError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/StreamError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/StreamError.html#message) [name](https://apify.github.io/impit/js/classes/StreamError.html#name) [stack](https://apify.github.io/impit/js/classes/StreamError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/StreamError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/StreamError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/StreamError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # TooManyRedirects | impit * [TooManyRedirects](https://apify.github.io/impit/js/classes/TooManyRedirects.html) Class TooManyRedirects ====================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#TooManyRedirects) , Expand) * [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) * TooManyRedirects ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/TooManyRedirects.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/TooManyRedirects.html#message) [name](https://apify.github.io/impit/js/classes/TooManyRedirects.html#name) [stack?](https://apify.github.io/impit/js/classes/TooManyRedirects.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/TooManyRedirects.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/TooManyRedirects.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/TooManyRedirects.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#constructor) * new TooManyRedirects(message?: string): [TooManyRedirects](https://apify.github.io/impit/js/classes/TooManyRedirects.html) [](https://apify.github.io/impit/js/classes/TooManyRedirects.html#constructortoomanyredirects) #### Parameters * `Optional`message: string #### Returns [TooManyRedirects](https://apify.github.io/impit/js/classes/TooManyRedirects.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/TooManyRedirects.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/TooManyRedirects.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/TooManyRedirects.html#message) [name](https://apify.github.io/impit/js/classes/TooManyRedirects.html#name) [stack](https://apify.github.io/impit/js/classes/TooManyRedirects.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/TooManyRedirects.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/TooManyRedirects.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/TooManyRedirects.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # StreamClosed | impit * [StreamClosed](https://apify.github.io/impit/js/classes/StreamClosed.html) Class StreamClosed ================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#StreamClosed) , Expand) * [StreamError](https://apify.github.io/impit/js/classes/StreamError.html) * StreamClosed ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/StreamClosed.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/StreamClosed.html#message) [name](https://apify.github.io/impit/js/classes/StreamClosed.html#name) [stack?](https://apify.github.io/impit/js/classes/StreamClosed.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/StreamClosed.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/StreamClosed.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/StreamClosed.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/StreamClosed.html#constructor) * new StreamClosed(message?: string): [StreamClosed](https://apify.github.io/impit/js/classes/StreamClosed.html) [](https://apify.github.io/impit/js/classes/StreamClosed.html#constructorstreamclosed) #### Parameters * `Optional`message: string #### Returns [StreamClosed](https://apify.github.io/impit/js/classes/StreamClosed.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/StreamClosed.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/StreamClosed.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/StreamClosed.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/StreamClosed.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/StreamClosed.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/StreamClosed.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/StreamClosed.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/StreamClosed.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/StreamClosed.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/StreamClosed.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/StreamClosed.html#message) [name](https://apify.github.io/impit/js/classes/StreamClosed.html#name) [stack](https://apify.github.io/impit/js/classes/StreamClosed.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/StreamClosed.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/StreamClosed.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/StreamClosed.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # UnsupportedProtocol | impit * [UnsupportedProtocol](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html) Class UnsupportedProtocol ========================= #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#UnsupportedProtocol) , Expand) * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) * UnsupportedProtocol ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#message) [name](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#name) [stack?](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#constructor) * new UnsupportedProtocol(message?: string): [UnsupportedProtocol](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html) [](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#constructorunsupportedprotocol) #### Parameters * `Optional`message: string #### Returns [UnsupportedProtocol](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#message) [name](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#name) [stack](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # TransportError | impit * [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) Class TransportError ==================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#TransportError) , Expand) * [RequestError](https://apify.github.io/impit/js/classes/RequestError.html) * TransportError * [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) * [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) * [ProtocolError](https://apify.github.io/impit/js/classes/ProtocolError.html) * [ProxyError](https://apify.github.io/impit/js/classes/ProxyError.html) * [UnsupportedProtocol](https://apify.github.io/impit/js/classes/UnsupportedProtocol.html) ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/TransportError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/TransportError.html#message) [name](https://apify.github.io/impit/js/classes/TransportError.html#name) [stack?](https://apify.github.io/impit/js/classes/TransportError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/TransportError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/TransportError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/TransportError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/TransportError.html#constructor) * new TransportError(message?: string): [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) [](https://apify.github.io/impit/js/classes/TransportError.html#constructortransporterror) #### Parameters * `Optional`message: string #### Returns [TransportError](https://apify.github.io/impit/js/classes/TransportError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/TransportError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/TransportError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/TransportError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/TransportError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/TransportError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/TransportError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/TransportError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/TransportError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/TransportError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/TransportError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/TransportError.html#message) [name](https://apify.github.io/impit/js/classes/TransportError.html#name) [stack](https://apify.github.io/impit/js/classes/TransportError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/TransportError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/TransportError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/TransportError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # WriteTimeout | impit * [WriteTimeout](https://apify.github.io/impit/js/classes/WriteTimeout.html) Class WriteTimeout ================== #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#WriteTimeout) , Expand) * [TimeoutError](https://apify.github.io/impit/js/classes/TimeoutError.html) * WriteTimeout ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/WriteTimeout.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/WriteTimeout.html#message) [name](https://apify.github.io/impit/js/classes/WriteTimeout.html#name) [stack?](https://apify.github.io/impit/js/classes/WriteTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/WriteTimeout.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/WriteTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/WriteTimeout.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/WriteTimeout.html#constructor) * new WriteTimeout(message?: string): [WriteTimeout](https://apify.github.io/impit/js/classes/WriteTimeout.html) [](https://apify.github.io/impit/js/classes/WriteTimeout.html#constructorwritetimeout) #### Parameters * `Optional`message: string #### Returns [WriteTimeout](https://apify.github.io/impit/js/classes/WriteTimeout.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/WriteTimeout.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/WriteTimeout.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/WriteTimeout.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/WriteTimeout.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/WriteTimeout.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/WriteTimeout.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/WriteTimeout.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/WriteTimeout.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/WriteTimeout.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/WriteTimeout.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/WriteTimeout.html#message) [name](https://apify.github.io/impit/js/classes/WriteTimeout.html#name) [stack](https://apify.github.io/impit/js/classes/WriteTimeout.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/WriteTimeout.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/WriteTimeout.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/WriteTimeout.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # WriteError | impit * [WriteError](https://apify.github.io/impit/js/classes/WriteError.html) Class WriteError ================ #### Hierarchy ([View Summary](https://apify.github.io/impit/js/hierarchy.html#WriteError) , Expand) * [NetworkError](https://apify.github.io/impit/js/classes/NetworkError.html) * WriteError ##### Index ### Constructors [constructor](https://apify.github.io/impit/js/classes/WriteError.html#constructor) ### Properties [message](https://apify.github.io/impit/js/classes/WriteError.html#message) [name](https://apify.github.io/impit/js/classes/WriteError.html#name) [stack?](https://apify.github.io/impit/js/classes/WriteError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/WriteError.html#stacktracelimit) ### Methods [captureStackTrace](https://apify.github.io/impit/js/classes/WriteError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/WriteError.html#preparestacktrace) Constructors ------------ ### constructor[](https://apify.github.io/impit/js/classes/WriteError.html#constructor) * new WriteError(message?: string): [WriteError](https://apify.github.io/impit/js/classes/WriteError.html) [](https://apify.github.io/impit/js/classes/WriteError.html#constructorwriteerror) #### Parameters * `Optional`message: string #### Returns [WriteError](https://apify.github.io/impit/js/classes/WriteError.html) Properties ---------- ### message[](https://apify.github.io/impit/js/classes/WriteError.html#message) message: string ### name[](https://apify.github.io/impit/js/classes/WriteError.html#name) name: string ### `Optional`stack[](https://apify.github.io/impit/js/classes/WriteError.html#stack) stack?: string ### `Static`stackTraceLimit[](https://apify.github.io/impit/js/classes/WriteError.html#stacktracelimit) stackTraceLimit: number The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods ------- ### `Static`captureStackTrace[](https://apify.github.io/impit/js/classes/WriteError.html#capturestacktrace) * captureStackTrace(targetObject: object, constructorOpt?: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) ): void[](https://apify.github.io/impit/js/classes/WriteError.html#capturestacktrace-1) Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: function a() { b();}function b() { c();}function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}a(); #### Parameters * targetObject: object * `Optional`constructorOpt: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) #### Returns void ### `Static`prepareStackTrace[](https://apify.github.io/impit/js/classes/WriteError.html#preparestacktrace) * prepareStackTrace(err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) , stackTraces: CallSite\[\]): any[](https://apify.github.io/impit/js/classes/WriteError.html#preparestacktrace-1) #### Parameters * err: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) * stackTraces: CallSite\[\] #### Returns any #### See[](https://apify.github.io/impit/js/classes/WriteError.html#see) [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Constructors [constructor](https://apify.github.io/impit/js/classes/WriteError.html#constructor) Properties [message](https://apify.github.io/impit/js/classes/WriteError.html#message) [name](https://apify.github.io/impit/js/classes/WriteError.html#name) [stack](https://apify.github.io/impit/js/classes/WriteError.html#stack) [stackTraceLimit](https://apify.github.io/impit/js/classes/WriteError.html#stacktracelimit) Methods [captureStackTrace](https://apify.github.io/impit/js/classes/WriteError.html#capturestacktrace) [prepareStackTrace](https://apify.github.io/impit/js/classes/WriteError.html#preparestacktrace) MMNEPVFCICPMFPCPTTAAATR --- # RequestInit | impit * [RequestInit](https://apify.github.io/impit/js/interfaces/RequestInit.html) Interface RequestInit ===================== Options for configuring an individual HTTP request. These options allow you to customize the behavior of a specific request, including the HTTP method, headers, body, timeout, and whether to force HTTP/3. If no options are provided, default settings will be used. See [Impit.fetch](https://apify.github.io/impit/js/classes/Impit.html#fetch) for usage. interface RequestInit {     [body](https://apify.github.io/impit/js/interfaces/RequestInit.html#body) ?:         | string         | [ArrayBuffer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)         | [DataView](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView)         | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)         | [Blob](https://developer.mozilla.org/docs/Web/API/Blob)         | [FormData](https://developer.mozilla.org/docs/Web/API/FormData)         | [URLSearchParams](https://developer.mozilla.org/docs/Web/API/URLSearchParams)         | [File](https://developer.mozilla.org/docs/Web/API/File)         | [ReadableStream](https://developer.mozilla.org/docs/Web/API/ReadableStream) ;     [forceHttp3](https://apify.github.io/impit/js/interfaces/RequestInit.html#forcehttp3) ?: boolean;     [headers](https://apify.github.io/impit/js/interfaces/RequestInit.html#headers) ?: [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) | \[string, string\]\[\] | [Headers](https://developer.mozilla.org/docs/Web/API/Headers) ;     [method](https://apify.github.io/impit/js/interfaces/RequestInit.html#method) ?: [HttpMethod](https://apify.github.io/impit/js/types/HttpMethod.html) ;     [redirect](https://apify.github.io/impit/js/interfaces/RequestInit.html#redirect) ?: "error" | "follow" | "manual";     [signal](https://apify.github.io/impit/js/interfaces/RequestInit.html#signal) ?: [AbortSignal](https://developer.mozilla.org/docs/Web/API/AbortSignal) ;     [timeout](https://apify.github.io/impit/js/interfaces/RequestInit.html#timeout) ?: number; } ##### Index ### Properties [body?](https://apify.github.io/impit/js/interfaces/RequestInit.html#body) [forceHttp3?](https://apify.github.io/impit/js/interfaces/RequestInit.html#forcehttp3) [headers?](https://apify.github.io/impit/js/interfaces/RequestInit.html#headers) [method?](https://apify.github.io/impit/js/interfaces/RequestInit.html#method) [redirect?](https://apify.github.io/impit/js/interfaces/RequestInit.html#redirect) [signal?](https://apify.github.io/impit/js/interfaces/RequestInit.html#signal) [timeout?](https://apify.github.io/impit/js/interfaces/RequestInit.html#timeout) Properties ---------- ### `Optional`body[](https://apify.github.io/impit/js/interfaces/RequestInit.html#body) body?:     | string     | [ArrayBuffer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)     | [DataView](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView)     | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)     | [Blob](https://developer.mozilla.org/docs/Web/API/Blob)     | [FormData](https://developer.mozilla.org/docs/Web/API/FormData)     | [URLSearchParams](https://developer.mozilla.org/docs/Web/API/URLSearchParams)     | [File](https://developer.mozilla.org/docs/Web/API/File)     | [ReadableStream](https://developer.mozilla.org/docs/Web/API/ReadableStream) Request body. Can be a string, Buffer, ArrayBuffer, TypedArray, DataView, Blob, File, URLSearchParams, FormData or ReadableStream. ### `Optional`forceHttp3[](https://apify.github.io/impit/js/interfaces/RequestInit.html#forcehttp3) forceHttp3?: boolean Force the request to use HTTP/3. If the server doesn't expect HTTP/3 or the Impit instance doesn't have HTTP/3 enabled (via the [ImpitOptions.http3](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#http3) option), the request will fail. ### `Optional`headers[](https://apify.github.io/impit/js/interfaces/RequestInit.html#headers) headers?: [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) | \[string, string\]\[\] | [Headers](https://developer.mozilla.org/docs/Web/API/Headers) Additional headers to include in the request. Can be an object, a Map, or an array of tuples or an instance of the [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) class. Note that headers set here will override any default headers set in [ImpitOptions.headers](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#headers) . Header matching is **case-insensitive** — for example, setting `user-agent` here will override the impersonation `User-Agent` header. To remove an impersonated header, pass an empty string as the value. ### `Optional`method[](https://apify.github.io/impit/js/interfaces/RequestInit.html#method) method?: [HttpMethod](https://apify.github.io/impit/js/types/HttpMethod.html) HTTP method to use for the request. Default is `GET`. Can be one of: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`. ### `Optional`redirect[](https://apify.github.io/impit/js/interfaces/RequestInit.html#redirect) redirect?: "error" | "follow" | "manual" The redirect mode to use for this request. * `'follow'` (default): Follow redirects automatically. * `'manual'`: Do not follow redirects; return the 3xx response as-is. * `'error'`: Throw a `TypeError` if the response is a redirect. When set, this overrides the instance-level [ImpitOptions.followRedirects](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#followredirects) option for this request. #### See[](https://apify.github.io/impit/js/interfaces/RequestInit.html#see) [Fetch API `redirect` option](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#redirect) ### `Optional`signal[](https://apify.github.io/impit/js/interfaces/RequestInit.html#signal) signal?: [AbortSignal](https://developer.mozilla.org/docs/Web/API/AbortSignal) Abort signal to cancel the request. ### `Optional`timeout[](https://apify.github.io/impit/js/interfaces/RequestInit.html#timeout) timeout?: number Request timeout in milliseconds. Overrides the Impit-wide timeout option from [ImpitOptions.timeout](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#timeout) . ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Properties [body](https://apify.github.io/impit/js/interfaces/RequestInit.html#body) [forceHttp3](https://apify.github.io/impit/js/interfaces/RequestInit.html#forcehttp3) [headers](https://apify.github.io/impit/js/interfaces/RequestInit.html#headers) [method](https://apify.github.io/impit/js/interfaces/RequestInit.html#method) [redirect](https://apify.github.io/impit/js/interfaces/RequestInit.html#redirect) [signal](https://apify.github.io/impit/js/interfaces/RequestInit.html#signal) [timeout](https://apify.github.io/impit/js/interfaces/RequestInit.html#timeout) MMNEPVFCICPMFPCPTTAAATR --- # Browser | impit * [Browser](https://apify.github.io/impit/js/types/Browser.html) Type Alias Browser ================== Browser:     | "chrome"     | "chrome100"     | "chrome101"     | "chrome104"     | "chrome107"     | "chrome110"     | "chrome116"     | "chrome124"     | "chrome125"     | "chrome131"     | "chrome136"     | "chrome142"     | "firefox"     | "firefox128"     | "firefox133"     | "firefox135"     | "firefox144" Supported browsers for emulation. See [ImpitOptions.browser](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#browser) for more details and usage. ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark MMNEPVFCICPMFPCPTTAAATR --- # ImpitOptions | impit * [ImpitOptions](https://apify.github.io/impit/js/interfaces/ImpitOptions.html) Interface ImpitOptions ====================== Options for configuring an [Impit](https://apify.github.io/impit/js/classes/Impit.html) instance. These options allow you to customize the behavior of the Impit instance, including browser emulation, TLS settings, proxy configuration, timeouts, and more. If no options are provided, default settings will be used. See [Impit](https://apify.github.io/impit/js/classes/Impit.html) for usage. interface ImpitOptions {     [browser](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#browser) ?: [Browser](https://apify.github.io/impit/js/types/Browser.html) ;     [cookieJar](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#cookiejar) ?: {         getCookieString: (url: string) \=> string | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) ;         setCookie: (cookie: string, url: string, cb?: any) \=> void | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) ;     };     [followRedirects](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#followredirects) ?: boolean;     [headers](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#headers) ?: [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)     | \[string, string\]\[\]     | [Headers](https://developer.mozilla.org/docs/Web/API/Headers) ;     [http3](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#http3) ?: boolean;     [ignoreTlsErrors](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#ignoretlserrors) ?: boolean;     [localAddress](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#localaddress) ?: string;     [maxRedirects](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#maxredirects) ?: number;     [proxyUrl](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#proxyurl) ?: string;     [timeout](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#timeout) ?: number;     [vanillaFallback](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#vanillafallback) ?: boolean; } ##### Index ### Properties [browser?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#browser) [cookieJar?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#cookiejar) [followRedirects?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#followredirects) [headers?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#headers) [http3?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#http3) [ignoreTlsErrors?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#ignoretlserrors) [localAddress?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#localaddress) [maxRedirects?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#maxredirects) [proxyUrl?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#proxyurl) [timeout?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#timeout) [vanillaFallback?](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#vanillafallback) Properties ---------- ### `Optional`browser[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#browser) browser?: [Browser](https://apify.github.io/impit/js/types/Browser.html) What browser to emulate. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default) `undefined` (no browser emulation) ### `Optional`cookieJar[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#cookiejar) cookieJar?: {     getCookieString: (url: string) \=> string | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) ;     setCookie: (cookie: string, url: string, cb?: any) \=> void | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) ; } Pass a [`ToughCookie`](https://github.com/salesforce/tough-cookie) instance to Impit. This `impit` instance will use the provided cookie jar for both storing and retrieving cookies. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-1) `undefined` (no cookie jar, i.e., cookies are not stored or sent across requests) ### `Optional`followRedirects[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#followredirects) followRedirects?: boolean Whether to follow redirects or not. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-2) `true` ### `Optional`headers[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#headers) headers?: [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) | \[string, string\]\[\] | [Headers](https://developer.mozilla.org/docs/Web/API/Headers) Additional headers to include in every request made by this Impit instance. Can be an object, a Map, or an array of tuples or an instance of the [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) class. These headers override any browser impersonation headers (set via the [ImpitOptions.browser](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#browser) option) and are in turn overridden by request-specific headers (set via [RequestInit.headers](https://apify.github.io/impit/js/interfaces/RequestInit.html#headers) ). Header matching is **case-insensitive** — for example, setting `user-agent` here will override the impersonation `User-Agent` header. To remove an impersonated header, pass an empty string as the value. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-3) `undefined` (no additional headers) ### `Optional`http3[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#http3) http3?: boolean Enable HTTP/3 support. **Warning:** Proxies are not supported when HTTP/3 is enabled. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-4) `false` ### `Optional`ignoreTlsErrors[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#ignoretlserrors) ignoreTlsErrors?: boolean Ignore TLS errors such as invalid certificates. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-5) `false` ### `Optional`localAddress[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#localaddress) localAddress?: string Local address to bind the client to. Useful for testing purposes or when you want to bind the client to a specific network interface. Can be an IP address in the format `xxx.xxx.xxx.xxx` (for IPv4) or `ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff` (for IPv6). #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-6) `undefined` (the OS will choose the local address) ### `Optional`maxRedirects[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#maxredirects) maxRedirects?: number Maximum number of redirects to follow. If this number is exceeded, the request will be rejected with an error. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-7) `10` ### `Optional`proxyUrl[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#proxyurl) proxyUrl?: string Proxy URL to use for this Impit instance. Supports HTTP, HTTPS, SOCKS4 and SOCKS5 proxies. **Warning:** Not supported when HTTP/3 is enabled. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-8) `undefined` (no proxy) ### `Optional`timeout[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#timeout) timeout?: number Default timeout for this Impit instance in milliseconds. ### `Optional`vanillaFallback[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#vanillafallback) vanillaFallback?: boolean Whether to fallback to a vanilla user-agent if the emulated browser is not supported by the target website. #### Default[](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#default-9) `false` ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark ### On This Page Properties [browser](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#browser) [cookieJar](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#cookiejar) [followRedirects](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#followredirects) [headers](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#headers) [http3](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#http3) [ignoreTlsErrors](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#ignoretlserrors) [localAddress](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#localaddress) [maxRedirects](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#maxredirects) [proxyUrl](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#proxyurl) [timeout](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#timeout) [vanillaFallback](https://apify.github.io/impit/js/interfaces/ImpitOptions.html#vanillafallback) MMNEPVFCICPMFPCPTTAAATR --- # ImpitWrapper | impit * [ImpitWrapper](https://apify.github.io/impit/js/types/ImpitWrapper.html) Type Alias ImpitWrapper ======================= ImpitWrapper: [Impit](https://apify.github.io/impit/js/classes/Impit.html) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark MMNEPVFCICPMFPCPTTAAATR --- # HttpMethod | impit * [HttpMethod](https://apify.github.io/impit/js/types/HttpMethod.html) Type Alias HttpMethod ===================== HttpMethod:     | "GET"     | "POST"     | "PUT"     | "DELETE"     | "PATCH"     | "HEAD"     | "OPTIONS"     | "TRACE" ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark MMNEPVFCICPMFPCPTTAAATR --- # TypedArray | impit * [TypedArray](https://apify.github.io/impit/js/types/TypedArray.html) Type Alias TypedArray ===================== TypedArray:     | [Int8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)     | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)     | [Uint8ClampedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)     | [Int16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)     | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)     | [Int32Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)     | [Uint32Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)     | [Float32Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)     | [Float64Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)     | [BigInt64Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)     | [BigUint64Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array) ### Settings Member Visibility * Protected * Inherited * External ThemeOSLightDark MMNEPVFCICPMFPCPTTAAATR --- # AsyncClient - impit documentation Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode [Skip to content](https://apify.github.io/impit/python/api/async-client.html#furo-main-content) [Back to top](https://apify.github.io/impit/python/api/async-client.html#) [View this page](https://apify.github.io/impit/python/_sources/api/async-client.rst.txt "View this page") AsyncClient[¶](https://apify.github.io/impit/python/api/async-client.html#asyncclient "Link to this heading") ============================================================================================================== --- # Client - impit documentation Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode [Skip to content](https://apify.github.io/impit/python/api/client.html#furo-main-content) [Back to top](https://apify.github.io/impit/python/api/client.html#) [View this page](https://apify.github.io/impit/python/_sources/api/client.rst.txt "View this page") Client[¶](https://apify.github.io/impit/python/api/client.html#client "Link to this heading") ============================================================================================== --- # Unknown impit for Python =================== .. toctree:: :maxdepth: 2 :glob: api/\* README =================== .. include:: ../README.md :parser: myst\_parser.sphinx\_ --- # Response - impit documentation Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode [Skip to content](https://apify.github.io/impit/python/api/response.html#furo-main-content) [Back to top](https://apify.github.io/impit/python/api/response.html#) [View this page](https://apify.github.io/impit/python/_sources/api/response.rst.txt "View this page") Response[¶](https://apify.github.io/impit/python/api/response.html#response "Link to this heading") ==================================================================================================== ---