> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Esta função pode ser usada para testar a segurança contra exceções. Ela lançará uma exceção durante a criação com a probabilidade especificada.

# aggThrow

<div id="aggThrow">
  ## aggThrow
</div>

Introduzido na versão: v20.1.0

Esta função pode ser usada para testar a segurança contra exceções. Ela lançará uma exceção durante a criação com a probabilidade especificada.

**Sintaxe**

```sql theme={null}
aggThrow(throw_prob)
```

**Argumentos**

* `throw_prob` — Probabilidade de lançar uma exceção durante a criação. [`Float64`](/pt-BR/reference/data-types/float)

**Valor retornado**

Retorna uma exceção: `Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully`.

**Exemplos**

**Exemplo de uso**

```sql title=Query theme={null}
SELECT number % 2 AS even, aggThrow(number) FROM numbers(10) GROUP BY even;
```

```response title=Response theme={null}
Received exception:
Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully: While executing AggregatingTransform. (AGGREGATE_FUNCTION_THROW)
```
