Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Union

StreamError

union struct StreamError

Module: System.IO
Assembly: System.Runtime.dll
Source file: StreamError.rvn

Inheritance: Object → ValueType → StreamError
Implements: Error

Expected file-stream failures represented as typed cases. The error taxonomy is provisional.

Remarks

Opening and transferring currently share this error type. It is distinct from Task cancellation and runtime faults. Do not use an uninitialized/default carrier. Use named case patterns. The default union is inactive: HasValue is false, Value is null and ToString returns Empty.

Cases

13 cases

Properties

5 items
Cause: Optional<Error> Leaf failures have no underlying cause. Implements Error.Cause
HasValue: bool Reports whether the union contains an active case.
Message: string A human-readable case description; use patterns to classify this failure. Implements Error.Message
StackTrace: Optional<StackTrace> Leaf failures do not capture stacks implicitly. Implements Error.StackTrace
Value: object? Projects the active case as an Object for compiler support.

Methods

7 items
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
Extension member: FormatError() -> string Formats up to 64 error layers and one existing trace; never captures a stack. A longer or cyclic chain ends with a truncation marker. Messages are not machine codes. Extension from ErrorFormattingExtensions.FormatError
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string Returns the active case name, or Empty for an inactive default. Overrides Object.ToString
Extension member: WithContext(message: string, captureStackTrace: bool) -> ContextError<StreamError> Adds context, optionally capturing once at this boundary when no cause trace exists. Extension from ErrorExtensions.WithContext
Extension member: WithContext(message: string) -> ContextError<StreamError> Adds context using the application capture setting (disabled by default). Extension from ErrorExtensions.WithContext