Hyperlinkv0.8.0-beta.28

ErrorReporter

ErrorReporter.ignoretypeeffect/ErrorReporter.ts:331
"~effect/ErrorReporter/ignore"

Defines the string property key used to mark an object error as ignored by error reporting.

When to use

Use to type the property key that suppresses reporting for expected object errors.

Details

Set this property to true on an error class or object error to prevent it from being forwarded to reporters. This is useful for expected failures such as HTTP 404 responses.

annotations
export type ignore = "~effect/ErrorReporter/ignore"

/**
 * Defines the runtime property key used to mark an object error as ignored by error
 * reporting.
 *
 * **When to use**
 *
 * Use to suppress reporting for expected object errors, such as HTTP 404
 * responses.
 *
 * **Details**
 *
 * Set `error[ErrorReporter.ignore]` to `true` to prevent the error from being
 * forwarded to reporters. This is useful for expected failures such as HTTP 404
 * responses.
 *
 * **Example** (Marking errors as ignored)
 *
 * ```ts
 * import { Data, ErrorReporter } from "effect"
 *
 * class NotFoundError extends Data.TaggedError("NotFoundError")<{}> {
 *   readonly [ErrorReporter.ignore] = true
 * }
 * ```
 *
 * @see {@link isIgnored} for checking whether a value carries this annotation
 * @see {@link Reportable} for the annotation contract recognized on object
 * errors
 *
 * @category annotations
 * @since 4.0.0
 */
export const ignore: ignore = "~effect/ErrorReporter/ignore"
Referenced by 2 symbols