# assertPieceValid

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

Defined in: [packages/synapse-core/src/utils/add-pieces-fits.ts:230](https://github.com/FilOzone/synapse-sdk/blob/5989c4b03ed2fe4cf8b1ef29efe1d4ff1ad4c7bc/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/)