Achieve — High Level Logic Project. Creating a new meta design pattern.

Friendly in development. Fast in production. Just build your apps. Let Achieve do the rest.

← Back to technical specifications

Achieve Error Handling and Response Recovery

Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2

Achieve separates errors it can convert into a complete HTTP response from failures that occur after response transmission has begun. That boundary prevents a second status or body from being written over an incomplete response.

Errors before response headers

Routing and static-resource outcomes use specific responses such as 403, 404, 406, and 500. An existing ordinary static file with an unregistered suffix is not treated as an error; it is served with Content-Type: text/plain. A JavaScript Servlet load failure, synchronous exception, or rejected returned Promise is caught by the managed invocation path. If headers have not been sent, Achieve can return a controlled 500 response and record the diagnostic.

HEAD follows the same status selection without writing response content. Normal application status choices remain intact; status-specific response rules such as empty 205 responses are enforced at the completion boundary.

Failures after transmission begins

Once headers have been sent, replacing the response with a new 500 would create invalid or misleading output. Achieve records the error and destroys the incomplete response. Clients observe an incomplete or reset transfer rather than a fabricated successful completion.

Write, end, and destruction lifecycle behavior remains delegated to the native Node response object. Achieve does not manufacture successful callbacks for writes that Node would reject.

Servlet ownership

With the default session.autoEnd = true, Achieve waits for a returned Promise and completes the response from its resolved value. Managed synchronous and asynchronous failures reach the same error boundary.

With session.autoEnd = false, application code owns normal completion. Errors that still propagate through the managed invocation can be handled before headers are sent, but detached asynchronous work after the servlet returns is the application's responsibility. See JavaScript Servlet Lifecycle.

Diagnostics and disclosure

Server-side diagnostics retain the underlying error for development or configured persistent logging, including stack information when an Error object is available. Managed catchall failures use a controlled client response; resource-specific errors can report a bounded reason without sending a server-side stack. Development mode adds console diagnostics; persistent production logging is explicitly configured. See Logging in Achieve.

Runtime and application boundaries

Node owns parser errors, socket failures, TLS failures, and protocol events that occur before a safe request reaches Achieve. Achieve handles its routing, resource, servlet-loading, and managed-invocation failures. Applications remain responsible for deliberately owned streams, detached work, external dependencies, and errors they catch or suppress themselves.

Verification

Regression tests exercise missing and denied resources, servlet load and execution failures, synchronous throws, asynchronous rejections, HEAD failures, errors before and after headers, application-owned completion, client aborts, native write validation, callback ordering, connection reuse, and subsequent healthy requests across HTTP, HTTPS, h2c, and secure HTTP/2.

The tests establish the supported managed paths; they do not promise recovery from process-level faults, exhausted operating-system resources, or arbitrary application code that terminates the process.