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

> Esta función puede usarse para probar la seguridad ante excepciones. Lanzará una excepción al crearse con la probabilidad especificada.

# aggThrow

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

Introducido en: v20.1.0

Esta función puede utilizarse para probar la seguridad ante excepciones. Lanzará una excepción al crearse con la probabilidad especificada.

**Sintaxis**

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

**Argumentos**

* `throw_prob` — Probabilidad de lanzar una excepción durante la creación. [`Float64`](/es/reference/data-types/float)

**Valor devuelto**

Devuelve una excepción: `Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully`.

**Ejemplos**

**Ejemplo 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)
```
