Hyperlinkv0.8.0-beta.28

SchemaIssue

SchemaIssue.makeFormatterDefaultfunctioneffect/SchemaIssue.ts:1100
(): Formatter<string>

Creates a Formatter that converts an Issue into a human-readable multi-line string.

When to use

Use when you need to format a SchemaIssue.Issue as error messages for logging, CLI output, or developer-facing diagnostics.

Details

This is the default formatter used by SchemaIssue.toString().

  • Flattens the issue tree into { message, path } entries using defaultLeafHook and defaultCheckHook.
  • Each entry is rendered as "<message>" or "<message>\n at <path>".
  • Multiple entries are joined with newlines.

Example (Formatting an issue as a string)

import { SchemaIssue } from "effect"

const formatter = SchemaIssue.makeFormatterDefault()
export function makeFormatterDefault(): Formatter<string> {
  return (issue) =>
    toDefaultIssues(issue, [], defaultLeafHook, defaultCheckHook)
      .map(formatDefaultIssue)
      .join("\n")
}