# Function: protocolError()

```ts
function protocolError(
   code, 
   message, 
   hint?
): ProtocolError;
```

Defined in: [packages/core/src/utils/errors.ts:32](https://github.com/leifriksheim/minca/blob/main/core/src/utils/errors.ts#L32)

Creates a tagged protocol error.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `code` | [`ProtocolErrorCode`](https://minca.dev/api/core/type-aliases/ProtocolErrorCode.md) |
| `message` | `string` |
| `hint?` | `string` |

## Returns

[`ProtocolError`](https://minca.dev/api/core/interfaces/ProtocolError.md)
