AutomationException - Global
concept brazil Updated Sep 10, 2026 1 min read c_AutomationException.md
The AutomationException script include provides generic exception wrapping for automation.
Include this in automation code to implement error handling.
Parent Topic:Server API reference
AutomationException - getMessage()
Retrieves the error message.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| String | The error message |
JavaScript
var ae = new AutomationException("This is an error message");gs.print(ae.getMessage());Output:
Text
This is an error message46 lines · 1.2 KB
---
title: AutomationException - Global
description: The AutomationException script include provides generic exception wrapping for automation.Retrieves the error message.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/api-reference/server-api-reference/c\_AutomationException.html
release: brazil
product: Server API Reference
classification: server-api-reference
topic_type: concept
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Server API reference, API reference, API implementation and reference]
---
# AutomationException- Global
The AutomationException script include provides generic exception wrapping for automation.
Include this in automation code to implement error handling.
**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/server-api-reference/api-server.md)
## AutomationException - getMessage\(\)
Retrieves the error message.
|Name|Type|Description|
|----|----|-----------|
|None| | |
|Type|Description|
|----|-----------|
|String|The error message|
```
var ae = new AutomationException("This is an error message");
gs.print(ae.getMessage());
```
Output:
```
This is an error message
```
| title | AutomationException - Global |
| description | The AutomationException script include provides generic exception wrapping for automation.Retrieves the error message. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/api-reference/server-api-reference/c\_AutomationException.html |
| release | brazil |
| product | Server API Reference |
| classification | server-api-reference |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Server API referenceAPI referenceAPI implementation and reference |