# assertPieceValid

> **assertPieceValid**(`piece`): `void`

Defined in: [packages/synapse-core/src/utils/add-pieces-fits.ts:230](https://github.com/FilOzone/synapse-sdk/blob/98fbbf01f083f74982cc75b1d527f6952d8b4492/packages/synapse-core/src/utils/add-pieces-fits.ts#L230)

Throw if a piece can never be added: its PieceCID size is outside Curio's upload bounds or its
metadata exceeds the contract limits. Use it to reject bad pieces before any network work.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `piece` | [`LimiterPiece`](/reference/filoz/synapse-core/utils/type-aliases/limiterpiece/) | The piece to check. |

## Returns

`void`

## Throws

Errors [assertPieceValid.ErrorType](/reference/filoz/synapse-core/utils/namespaces/assertpiecevalid/type-aliases/errortype/)