# SSJS error handling, WSProxy and Script Activities

*Marketing Cloud Engagement Developer Study Guide · Programmatic Languages · Last updated November 3, 2026 · https://www.certifyforce.com/study-guide/marketing-cloud-engagement-developer/programmatic-languages/ssjs-error-handling-wsproxy-and-script-activities*

When a Script activity succeeds or fails, how try/catch and logging data extensions keep it running, why WSProxy beats the Core SOAP wrappers and never throws on its own, and how timeouts, memory, batching and HTTP caching shape scripts that scale.

- Certification: Salesforce Marketing Cloud Engagement Developer
- Exam section: Programmatic Languages
- Study guide: https://www.certifyforce.com/study-guide/marketing-cloud-engagement-developer

**Official exam objective:**

> Implement standard development best practices using Marketing Cloud programming languages.

## What the exam expects

- Predict whether a Script activity completes or fails when code raises, catches or times out.
- Log handled errors to a data extension and surface WSProxy errors that don't throw.
- Choose WSProxy over Core library SOAP methods, and know where WSProxy can run.
- Keep large jobs inside memory and time limits with batching, paging and a different tool when needed.
- Keep external calls fast and safe: cache-friendly URLs, standard ports and guarded JSON parsing in email.
- Key terms: **Script activity** (an Automation Studio activity that runs SSJS); **unhandled exception** (an error no catch block handles); **WSProxy** (the native SSJS object for SOAP API calls); **non-send context** (code that doesn't run while a message renders, such as a Script activity or CloudPage); **HasMoreRows** (the retrieve flag that says another page exists).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Script activity success | Completes unless an unhandled exception or timeout | [Validate SSJS using WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_error_handling.html) |
| Caught errors | Don't fail the activity | [Validate SSJS using WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_error_handling.html) |
| WSProxy errors | Returned in Status; use `ErrorUtil.ThrowWSProxyError()` to throw | [Validate SSJS using WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_error_handling.html) |
| Memory ceiling | More than 6GB fails the activity | [Validate SSJS using WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_error_handling.html) |
| Timeout | 30 minutes; rethink scripts over 10 minutes | [Server-Side JavaScript](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_serverSideJavaScript.html), [Script Activity](https://help.salesforce.com/s/articleView?id=mktg.mc_as_create_a_script_activity_1.htm&type=5&language=en_US) |
| WSProxy availability | All non-send contexts | [Use SSJS via WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_useSSJS.html) |
| More pages | `HasMoreRows` true; page with `getNextBatch()` | [Advanced Retrieves via WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_advanced_retrieve.html) |
| Rows.Update() no match | Returns an error | [Rows.Update](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_dataExtensionRowsUpdate.html) |
| Validate Syntax | Checks syntax only, not a successful run | [Create a Script Activity](https://help.salesforce.com/s/articleView?id=mktg.mc_as_create_a_script_activity.htm&type=5&language=en_US) |
| HttpGet() caching | One call per unique URL in a send | [HttpGet()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-get.html) |

## Check yourself

- Why doesn't a passing Validate Syntax check prove a Script activity will succeed?
- When does HttpGet() skip the email for a subscriber?
- What does Rows.Remove() return?
- Which WSProxy retrieve parameter carries RetrieveOptions such as BatchSize?
- Why should a logging data extension have a data retention policy?

## Sources

- [Validate Your Server-Side JavaScript using WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_error_handling.html)
- [Use Server-Side JavaScript via WSProxy with the SOAP API](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_useSSJS.html)
- [Basic Retrieves via WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_basic_retrieve.html)
- [Advanced Retrieves via WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_advanced_retrieve.html)
- [Server-Side JavaScript](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_serverSideJavaScript.html)
- [Script Activity](https://help.salesforce.com/s/articleView?id=mktg.mc_as_create_a_script_activity_1.htm&type=5&language=en_US)
- [Create a Script Activity](https://help.salesforce.com/s/articleView?id=mktg.mc_as_create_a_script_activity.htm&type=5&language=en_US)
- [Crafting Effective Scripts (Trailhead)](https://trailhead.salesforce.com/content/learn/modules/marketing-cloud-programmatic-languages/write-your-best-scripts-with-programmatic-languages-)
- [Rows.Remove (SSJS)](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_dataExtensionRowsRemove.html)
- [Rows.Update (SSJS)](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_dataExtensionRowsUpdate.html)
- [HttpGet() (AMPscript)](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-get.html)
- [HTTP.Get() (SSJS)](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_httpGet.html)
- [ParseJSON (SSJS)](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformUtilityParseJSON.html)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 12 linked practice questions, and unlimited timed mock exams are included with the Marketing Cloud Engagement Developer pack (USD $19): https://www.certifyforce.com/practice-exams
