# IMQError() function · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.imqerror/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.5.3 — generated reference, not hand-written

Builds a JSON representation of an IMQ error.

**Signature:**

```typescript
export declare function IMQError(code: string, message: string, stack: any, method: any, args: unknown, original?: unknown): IMQRPCError;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| code | string | error code |
| message | string | error message |
| stack | any | error stack |
| method | any | IMQ service method that produced the error |
| args | unknown | arguments passed to the service method call |
| original | unknown | _(Optional)_ original error thrown (JSON-serialized), if any |


**Returns:**

[IMQRPCError](https://imqueue.org/api/rpc/latest/rpc.imqrpcerror/)

