# Class BSV::Wallet::Error <a id="class-BSV-Wallet-Error"></a>

**Inherits:** `StandardError`

Base error for all wallet operations. Carries a machine-readable code per the
BRC-100 error structure and a wire-protocol stack string.

## Attributes
### `code` [R] <a id="attribute-i-code"></a> <a id="code-instance_method"></a>
Returns the value of attribute code.

### `wallet_stack` [R] <a id="attribute-i-wallet_stack"></a> <a id="wallet_stack-instance_method"></a>
Returns the value of attribute wallet_stack.

## Public Instance Methods
### `initialize(message = nil, code: = 1, stack: = '')` <a id="method-i-initialize"></a> <a id="initialize-instance_method"></a>
- **@return** [Error] a new instance of Error

### `to_wire()` <a id="method-i-to_wire"></a> <a id="to_wire-instance_method"></a>
Serialise to a hash suitable for embedding in a wire result frame. Never leaks
Ruby's internal backtrace — only the wallet_stack string.
