@btravstack/cache / redis
redis
Classes
CacheConnectionFailed
Defined in: packages/cache/src/redis.ts:24
The connection could not be opened at all — a wrong REDIS_URL, a server that is not listening, credentials the server refused.
Separate from CacheUnavailable, which is about one operation on one key and carries both: this happens before any key exists. Modeled because it is a startup failure an operator caused and can fix, so it deserves a message and an exit code — see CONNECT_ATTEMPTS for what it replaced, which was neither.
Extends
TaggedErrorInstance<"CacheConnectionFailed", {reason:string; }>
Constructors
Constructor
new CacheConnectionFailed(args): CacheConnectionFailed;Defined in: node_modules/.pnpm/unthrown@5.12.1/node_modules/unthrown/dist/index.d.mts:2386
Parameters
| Parameter | Type |
|---|---|
args | object & object |
Returns
Inherited from
TaggedError("CacheConnectionFailed")<{ readonly reason: string; }>.constructor
Properties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "CacheConnectionFailed" | TaggedError("CacheConnectionFailed")._tag | node_modules/.pnpm/unthrown@5.12.1/node_modules/unthrown/dist/index.d.mts:2363 |
cause? | public | unknown | TaggedError("CacheConnectionFailed").cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | TaggedError("CacheConnectionFailed").message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("CacheConnectionFailed").name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
reason | readonly | string | TaggedError("CacheConnectionFailed").reason | packages/cache/src/redis.ts:25 |
stack? | public | string | TaggedError("CacheConnectionFailed").stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
Functions
redisCache()
function redisCache(): Module<CacheBackend, CacheConnectionFailed | ConfigInvalid, EnvReading<"REDIS_URL", never> | Scope>;Defined in: packages/cache/src/redis.ts:158
The Redis adapter: one connection, opened with the scope and closed with it, and CacheBackend over it. Nothing here is per call — a client per operation would spend a handshake to save nothing and leave the drain with sockets it does not know about.
Returns
Module<CacheBackend, CacheConnectionFailed | ConfigInvalid, EnvReading<"REDIS_URL", never> | Scope>