Throw Error — Reference
Raise an exception that stops normal execution or is handled by Try/Catch.
Raise an exception that stops normal execution or is handled by Try/Catch.
Before you begin
Section titled “Before you begin”- An open Server Connect action. Runtime differences below refer to the installed Node.js and PHP implementations.
Throw Error
Section titled “Throw Error”Raise an exception that stops normal execution or is handled by Try/Catch.
Settings and execution
Section titled “Settings and execution”| Setting | Meaning |
|---|---|
| Message | The error message to raise. It is required. Use a diagnostic message for internal handling and a controlled client-facing response rather than exposing secrets or raw provider errors. |
Worked example
Section titled “Worked example”Add Throw Error with Message Test failure inside a Try block. Read $_ERROR in Catch and return a controlled failure result. Remove the Throw Error and confirm that the success path resumes.
Check the behavior and limits
Section titled “Check the behavior and limits”Throw Error is not the same as setting an HTTP status on a successful response. The installed PHP core method throws the configured message directly, while Node.js parses the required string; use a literal message for portable behavior.
Continue with a task
Section titled “Continue with a task”Use the Server Connect guides when you need the surrounding project, data-loading or form procedure.
Check your result
Section titled “Check your result”You can configure Throw Error deliberately and verify the result and failure behavior described in this reference.