The SFMC server-side JavaScript engine (Jint, an ES3/ES5-era dialect) provides the seven legacy Error subtype constructors but none of the newer aggregate/suppressed error types. This page catalogs each constructor’s runtime status; for the base Error constructor’s full parameter and message-shape details, see the dedicated Error() page.

Status legend

Icon Meaning
✅ Present Constructor exists and produces a throwable error object
❌ Missing Not available (typeof is "undefined"; new throws Unknown type)

Members

Member ES Status Notes
Error() ES3 ✅ Present Base constructor — see its own page
EvalError() ES3 ✅ Present Same shape as Error
RangeError() ES3 ✅ Present Same shape as Error
ReferenceError() ES3 ✅ Present Same shape as Error
SyntaxError() ES3 ✅ Present Same shape as Error
TypeError() ES3 ✅ Present Same shape as Error
URIError() ES3 ✅ Present Same shape as Error
AggregateError() ES2021 ❌ Missing typeof AggregateError === "undefined"
SuppressedError() ES2026 ❌ Missing typeof SuppressedError === "undefined"
InternalError() Non-standard ❌ Missing Firefox-only; typeof InternalError === "undefined"

Shared behaviour of the present subtypes

All seven present constructors (Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError) behave identically to each other, and identically to the base Error constructor:

  • new SubType("msg") and SubType("msg") (without new) both return an object.
  • .name correctly reflects the subtype (e.g. "TypeError", "RangeError").
  • .message reads back undefined — the constructor argument is lost. Recover it with String(err) or ("" + err); err.toString() returns "<name>: undefined".
  • .description is undefined.
  • Stringify(err) returns {} (empty) for a JS-constructed subtype.

EvalError

(ES3) — ✅ Present. Constructible; shares the common subtype behaviour. .name is "EvalError".

var e = new EvalError("bad eval");
Write(e.name);       // "EvalError"
Write(String(e));    // "bad eval"  (e.message is undefined)

RangeError

(ES3) — ✅ Present. Constructible; .name is "RangeError".

var e = new RangeError("out of range");
Write(e.name);       // "RangeError"
Write(String(e));    // "out of range"

ReferenceError

(ES3) — ✅ Present. Constructible; .name is "ReferenceError".

var e = new ReferenceError("missing var");
Write(e.name);       // "ReferenceError"

SyntaxError

(ES3) — ✅ Present. Constructible; .name is "SyntaxError".

var e = new SyntaxError("bad token");
Write(e.name);       // "SyntaxError"

TypeError

(ES3) — ✅ Present. Constructible; .name is "TypeError". The most useful subtype for guarding against wrong argument types in your own helpers.

function requireString(v) {
    if (typeof v != "string") {
        throw new TypeError("expected a string");
    }
    return v;
}
try {
    requireString(42);
} catch (e) {
    Write(e.name + ": " + String(e)); // "TypeError: expected a string"
}

URIError

(ES3) — ✅ Present. Constructible; .name is "URIError". Note that the URI functions themselves (decodeURI etc.) do not throw URIError on malformed input in this engine — see Global Functions.

var e = new URIError("bad uri");
Write(e.name);       // "URIError"

Missing error types

The following newer or non-standard error constructors are not defined in the SFMC engine. Use the base Error constructor instead.

AggregateError

(ES2021) — ❌ Missing. AggregateError (used with Promise.any) is not definedtypeof AggregateError === "undefined" and new AggregateError(...) throws Unknown type: AggregateError. Since Promise itself is absent, there is no scenario that would produce one.

SuppressedError

(ES2026) — ❌ Missing. SuppressedError (paired with using / disposable resources) is not definedtypeof SuppressedError === "undefined".

InternalError

(Non-standard) — ❌ Missing. InternalError is a Firefox-only, non-standard error type and is not defined in the SFMC engine — typeof InternalError === "undefined".

See Also