> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seasonlabs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Fail-open design

> Keep your agent running when Era is unavailable.

The Node SDK returns an empty string for expected Era service failures. Your
application can make its model call without Era context.

```typescript theme={null}
const eraContext = await era.turnContext(messages, {
  visitorId,
  sessionId,
});

// An empty string is safe to add to the prompt.
const systemPrompt = `You are a helpful assistant.\n\n${eraContext}`;
```

## Behavior by condition

| Error type                                    | Behavior                           |
| --------------------------------------------- | ---------------------------------- |
| Network error or timeout                      | Retry, then return `""` and warn   |
| HTTP 5xx                                      | Retry, then return `""` and warn   |
| HTTP 4xx                                      | Return `""` and warn; do not retry |
| Invalid response                              | Retry, then return `""` and warn   |
| No `visitorId`                                | Return `""` without a request      |
| Conversation does not end with a user message | Return `""` without a request      |

## Retry behavior

The default is one retry. Set `maxRetries` to change it:

```typescript theme={null}
const era = new Era({
  maxRetries: 2,
  timeoutMs: 3000,
});
```

Only transient failures are retried. A 4xx response usually means the API key,
partner ID, or request is wrong, so retrying the same request will not help.

## Logging

Warnings use `console.warn` by default. Pass your own logger if needed:

```typescript theme={null}
const era = new Era({
  logger: {
    warn: (message) => appLogger.warn(message),
    info: (message) => appLogger.info(message),
  },
});
```

Set `debug: true` to enable informational logs when you use the default logger.

Fail-open behavior does not hide errors in your own code. For example, the
`Era` constructor still throws when `mode` is not `"async"` or `"sync"`.
