---
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: 107
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/universe/die/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.82.0+

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")
```
