---
url: /technical/aborting-a-process-programmatically.md
description: Scripted processes can be aborted using a function.
---

# Aborting a Process Programmatically

Scripted processes can be aborted using a function. This function is used cancel the execution of a process when an error has occurred.

#### Usage

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

#### Parameters

* `reasonText` the line of text to output which explains why the process is aborting.

#### Example

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

When this example is executed the process will halt and a log will be added to the server log with the message **Something was not as expected**. This message will also show against the process in the process log.
