--- 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/australia/api-reference/server-api-reference/c\_AutomationException.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" 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/australia/markdown/australia/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 ```