[**@tevm/node**](../README.md)
***
[@tevm/node](../globals.md) / NativeRpcError
# Class: NativeRpcError
Defined in: packages/node/src/NativeRpcError.js:4
A native JSON-RPC failure, retaining the exact code and optional error data.
## Extends
- `BaseError`
## Constructors
### Constructor
> **new NativeRpcError**(`error`): `NativeRpcError`
Defined in: packages/node/src/NativeRpcError.js:8
#### Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `error` | \{ `code`: `number`; `data?`: [`JsonValue`](../type-aliases/JsonValue.md); `message`: `string`; \} | - |
| `error.code` | `number` | - |
| `error.data?` | [`JsonValue`](../type-aliases/JsonValue.md) | - |
| `error.message` | `string` | - |
#### Returns
`NativeRpcError`
#### Overrides
`BaseError.constructor`
## Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| `_tag` | `public` | `string` | - | `BaseError._tag` | packages/errors/types/ethereum/BaseError.d.ts:36 |
| `cause` | `public` | `any` | The cause of the error. | `BaseError.cause` | packages/errors/types/ethereum/BaseError.d.ts:61 |
| `code` | `public` | `number` | - | `BaseError.code` | packages/errors/types/ethereum/BaseError.d.ts:60 |
| `data` | `public` | [`JsonValue`](../type-aliases/JsonValue.md) \| `undefined` | - | - | packages/node/src/NativeRpcError.js:11 |
| `details` | `public` | `string` | - | `BaseError.details` | packages/errors/types/ethereum/BaseError.d.ts:40 |
| `docsPath` | `public` | `string` \| `undefined` | - | `BaseError.docsPath` | packages/errors/types/ethereum/BaseError.d.ts:44 |
| `message` | `public` | `string` | - | `BaseError.message` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1075 |
| `metaMessages` | `public` | `string`[] \| `undefined` | - | `BaseError.metaMessages` | packages/errors/types/ethereum/BaseError.d.ts:48 |
| `name` | `public` | `string` | - | `BaseError.name` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1074 |
| `shortMessage` | `public` | `string` | - | `BaseError.shortMessage` | packages/errors/types/ethereum/BaseError.d.ts:52 |
| `stack?` | `public` | `string` | - | `BaseError.stack` | node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| `version` | `public` | `string` | - | `BaseError.version` | packages/errors/types/ethereum/BaseError.d.ts:56 |
| `stackTraceLimit` | `static` | `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. | `BaseError.stackTraceLimit` | node\_modules/.pnpm/@types+node@24.12.4/node\_modules/@types/node/globals.d.ts:68 |
## Methods
### walk()
> **walk**(`fn?`): `unknown`
Defined in: packages/errors/types/ethereum/BaseError.d.ts:67
Walks through the error chain.
#### Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `fn?` | `Function` | A function to execute on each error in the chain. |
#### Returns
`unknown`
The first error that matches the function, or the original error.
#### Inherited from
`BaseError.walk`
***
### captureStackTrace()
#### Call Signature
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
Defined in: node\_modules/.pnpm/@types+node@24.12.4/node\_modules/@types/node/globals.d.ts:52
Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
`Error.captureStackTrace()` was called.
```js
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:
```js
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
| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |
##### Returns
`void`
##### Inherited from
`BaseError.captureStackTrace`
#### Call Signature
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
Defined in: node\_modules/.pnpm/bun-types@1.3.14/node\_modules/bun-types/globals.d.ts:1042
Create .stack property on a target object
##### Parameters
| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |
##### Returns
`void`
##### Inherited from
`BaseError.captureStackTrace`
***
### isError()
#### Call Signature
> `static` **isError**(`error`): `error is Error`
Defined in: node\_modules/.pnpm/typescript@6.0.3/node\_modules/typescript/lib/lib.esnext.error.d.ts:21
Indicates whether the argument provided is a built-in Error instance or not.
##### Parameters
| Parameter | Type |
| ------ | ------ |
| `error` | `unknown` |
##### Returns
`error is Error`
##### Inherited from
`BaseError.isError`
#### Call Signature
> `static` **isError**(`value`): `value is Error`
Defined in: node\_modules/.pnpm/bun-types@1.3.14/node\_modules/bun-types/globals.d.ts:1037
Check if a value is an instance of Error
##### Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `unknown` | The value to check |
##### Returns
`value is Error`
True if the value is an instance of Error, false otherwise
##### Inherited from
`BaseError.isError`
***
### prepareStackTrace()
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
Defined in: node\_modules/.pnpm/@types+node@24.12.4/node\_modules/@types/node/globals.d.ts:56
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `err` | `Error` |
| `stackTraces` | `CallSite`[] |
#### Returns
`any`
#### See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
#### Inherited from
`BaseError.prepareStackTrace`