[**@tevm/errors**](../README.md) *** [@tevm/errors](../globals.md) / InvalidArgsError # Class: InvalidArgsError Represents an error that occurs when the arguments provided to a function or method are invalid. This error is typically encountered when a function receives arguments that don't match the expected types or format. ## Example ```javascript import { InvalidArgsError } from '@tevm/errors' import { createMemoryClient } from '@tevm/memory-client' const client = createMemoryClient() try { await client.contract({ address: '0x...', functionName: 'transfer', args: ['not_an_address', 'not_a_number'], // Invalid args abi: [...], }) } catch (error) { if (error instanceof InvalidArgsError) { console.error('Invalid arguments:', error.message) console.log('Documentation:', error.docsLink) } } ``` ## Extends - [`InvalidParamsError`](InvalidParamsError.md) ## Constructors ### Constructor > **new InvalidArgsError**(`message`, `args?`): `InvalidArgsError` Constructs an InvalidArgsError. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | Human-readable error message. | | `args?` | [`InvalidArgsErrorParameters`](../interfaces/InvalidArgsErrorParameters.md) | Additional parameters for the InvalidArgsError. | #### Returns `InvalidArgsError` #### Overrides [`InvalidParamsError`](InvalidParamsError.md).[`constructor`](InvalidParamsError.md#constructor) ## Properties | Property | Modifier | Type | Default value | Description | Inherited from | | ------ | ------ | ------ | ------ | ------ | ------ | | `_tag` | `public` | `string` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`_tag`](InvalidParamsError.md#_tag) | | `cause` | `public` | `any` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`cause`](InvalidParamsError.md#cause) | | `code` | `public` | `number` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`code`](InvalidParamsError.md#code) | | `details` | `public` | `string` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`details`](InvalidParamsError.md#details) | | `docsPath` | `public` | `string` \| `undefined` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`docsPath`](InvalidParamsError.md#docspath) | | `metaMessages` | `public` | `string`[] \| `undefined` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`metaMessages`](InvalidParamsError.md#metamessages) | | `name` | `public` | `string` | `undefined` | - | `InvalidParamsError.name` | | `shortMessage` | `public` | `string` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`shortMessage`](InvalidParamsError.md#shortmessage) | | `version` | `public` | `string` | `undefined` | - | [`InvalidParamsError`](InvalidParamsError.md).[`version`](InvalidParamsError.md#version) | | `code` | `static` | `number` | `-32602` | The error code for InvalidParamsError. | [`InvalidParamsError`](InvalidParamsError.md).[`code`](InvalidParamsError.md#code-1) | ## Methods ### walk() > **walk**(`fn?`): `unknown` 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 [`InvalidParamsError`](InvalidParamsError.md).[`walk`](InvalidParamsError.md#walk)