v0.27.0
Minor Changes
-
b917060: Replace
defineErrorwith fluentcreateTaggedErrorAPIThe
createTaggedErrorfunction now uses a fluent builder pattern for type constraints:// Simple usage (flexible mode) const { NetworkError, NetworkErr } = createTaggedError("NetworkError"); // Required context const { ApiError } = createTaggedError("ApiError").withContext<{ endpoint: string; status: number; }>(); // Optional typed context const { LogError } = createTaggedError("LogError").withContext< { file: string; line: number } | undefined >(); // Chaining both context and cause const { RepoError } = createTaggedError("RepoError") .withContext<{ entity: string }>() .withCause<DbError | undefined>();
Breaking changes:
defineErrorhas been removed (usecreateTaggedErrorinstead)- The old
createTaggedErrorgeneric overloads are removed in favor of the fluent API