← All packages

@searsuite/sear-foundation-error

Structured public errors with stable codes and diagnostic details.

classSearError
class SearError extends Error

Base class for errors intentionally exposed by SearSuite packages.

Packages may throw this generic form while they do not need a more specific public error type. Domain-specific subclasses override code.

constructorSearError(message: string, details?: SearErrorDetails, options?: ErrorOptions): SearError
propertyreadonly code: string

Stable machine-readable identifier for this error category.

propertyreadonly details: SearErrorDetails
methodreport(): this

Reports this error with a compact, styled console header and diagnostics. Returning the error keeps throw new SearError(...).report() ergonomic.

Inherited members 7
  • cause
  • message
  • name
  • stack
  • stackTraceLimit
  • captureStackTrace
  • prepareStackTrace
typeSearErrorDetails
type SearErrorDetails = Readonly<Record<string, unknown>>

Machine-readable context attached to framework errors.