---
url: /process-functions/script-abort.md
description: Marks the process as aborted, with a reason.
---

# script.abort

Marks the process as aborted when an unhandled error has occurred. The reason is written to the process log and shown when the run ends.

The current function keeps running until it returns. To stop straight away, use [script.fail](/process-functions/script-fail).

```js
script.abort(reasonText)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `reasonText` | `string` | Why the process is aborting. |

## Examples

```js
script.abort('Something was not as expected.');
```

## Related

* [script.fail](/process-functions/script-fail)
* [script.complete](/process-functions/script-complete)
