Skip to main content
Every error carries a class. The class determines the exit code; the code identifies the cause. A model never selects either.

AgentError

Test files load in their own module realm, so instanceof AgentError can be false for an error the runner threw. Use isAgentError, exported from @e2edev/e2e, which checks a cross-realm marker, and branch on code:

Runner codes

These appear in terminal output and in the report as plain string codes. Errors raised by argument validation in test code use INVALID_ARGUMENT and INVALID_LOCATOR, both test failures with exit code 1. An unclassified thrown value from test code is reported as ERROR. The internal class and exit code 4 are reserved for runner invariant violations; no first-party code raises a code in that class today.

Exit codes

Precedence:
For a mixed run the highest-precedence code present wins. The report keeps every individual result; precedence affects only the process exit code. A run with one infrastructure failure and forty test failures exits 3. A setup assertion failure is a test failure and skips its dependents. Missing setup infrastructure keeps its own configuration or infrastructure class.

Debugging a run

CLI

agent

Config