---
title: die() function
description: die() stops the Flux script execution and returns an error message.
url: https://docs.influxdata.com/flux/v0/stdlib/universe/die/
estimated_tokens: 364
product: Flux
version: v0
---

# die() function

-   Flux 0.82.0+
-   View InfluxDB support

`die()` stops the Flux script execution and returns an error message.

##### Function type signature

```js
(msg: string) => A
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### msg

(Required) Error message to return.

## Examples

### Force a script to exit with an error message

```js
die(msg: "This is an error message")
```
