Node.assume succeeded once already — tokens are single-use for Track A handoff.
errors
Source src/internal/nodeAssume.ts:4710 lines
export class class AssumeTokenReusedclass AssumeTokenReused {
message: string;
_tag: 'AssumeTokenReused';
node: string;
name: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Node.assume succeeded once already — tokens are single-use for Track A handoff.
AssumeTokenReused extends import SchemaSchema.const TaggedErrorClass: {
<Self = never, Brand = {}>(
identifier?: string
): {
<
Tag extends string,
Fields extends Struct.Fields
>(
tag: Tag,
fields: Fields,
annotations?: Annotations.Declaration<
Self,
readonly [TaggedStruct<Tag, Fields>]
>
): [Self] extends [never]
? MissingSelfGeneric<"Schema.TaggedErrorClass">
: Class<
Self,
TaggedStruct<Tag, Fields>,
Cause_.YieldableError & Brand
>
<
Tag extends string,
S extends Struct<Struct.Fields>
>(
tag: Tag,
schema: S,
annotations?: Annotations.Declaration<
Self,
readonly [
Struct<
Simplify<
{
readonly _tag: tag<Tag>
} & S["fields"]
>
>
]
>
): [Self] extends [never]
? MissingSelfGeneric<"Schema.TaggedErrorClass">
: Class<
Self,
Struct<
Simplify<
{
readonly _tag: tag<Tag>
} & S["fields"]
>
>,
Cause_.YieldableError & Brand
>
}
}
Defines a schema-backed yieldable error class with an automatically populated
_tag field.
When to use
Use to define typed errors that are schema validated, yielded in Effect.gen,
and matched as tagged union members.
Example (Defining a tagged error class)
import { Effect, Schema } from "effect"
class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
id: Schema.Number
}) {}
const program = Effect.gen(function*() {
yield* new NotFound({ id: 42 })
})
TaggedErrorClass<class AssumeTokenReusedclass AssumeTokenReused {
message: string;
_tag: 'AssumeTokenReused';
node: string;
name: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Node.assume succeeded once already — tokens are single-use for Track A handoff.
AssumeTokenReused>()(
"AssumeTokenReused",
{
node: Schema.String(property) node: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
node: import SchemaSchema.const String: Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: MakeOptions) => string;
makeOption: (input: string, options?: MakeOptions) => Option_.Option<string>;
makeEffect: (input: string, options?: MakeOptions) => Effect.Effect<string, SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String,
},
) {
override get AssumeTokenReused.message: stringmessage() {
return `Node.assume token already used for "${this.node: stringnode}" — handoff is single-use.`;
}
}
Referenced by 3 symbols