Hyperlinkv0.8.0-beta.28

PlatformError

PlatformError.SystemErrorclasseffect/PlatformError.ts:109
SystemError

Error data for a platform or system operation failure.

When to use

Use when you need normalized reason data for a platform or system operation failure, including the operation details.

Details

The error records a normalized _tag, the module and method that failed, and optional details such as the syscall, path or descriptor, description, and original cause. It is usually wrapped in PlatformError.

export class SystemError extends Data.Error<{
  _tag: SystemErrorTag
  module: string
  method: string
  description?: string | undefined
  syscall?: string | undefined
  pathOrDescriptor?: string | number | undefined
  cause?: unknown
}> {
  /**
   * Formats the normalized system error tag with operation and path details.
   *
   * **When to use**
   *
   * Use to read the formatted error message for a normalized system failure.
   *
   * @since 4.0.0
   */
  override get message(): string {
    return `${this._tag}: ${this.module}.${this.method}${
      this.pathOrDescriptor !== undefined ? ` (${this.pathOrDescriptor})` : ""
    }${this.description ? `: ${this.description}` : ""}`
  }
}
Referenced by 2 symbols