# Function: getTRPCErrorFromUnknown()

> 

> **getTRPCErrorFromUnknown**(`cause`): [`TRPCError`](https://trpc.io/docs/typedoc/server/index/classes/TRPCError.md)

Defined in: [packages/server/src/unstable-core-do-not-import/error/TRPCError.ts:64](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/server/src/unstable-core-do-not-import/error/TRPCError.ts#L64)

Turns anything thrown into a `TRPCError`. A `TRPCError` is returned as
is; anything else becomes an `INTERNAL_SERVER_ERROR` with it as the
cause.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `cause` | `unknown` |

## Returns

[`TRPCError`](https://trpc.io/docs/typedoc/server/index/classes/TRPCError.md)
