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
case InvalidPath
The path is empty, contains a NUL, or is rejected as invalid by the host.
case NotFound
The requested file or a required parent does not exist.
case AccessDenied
The host denies access.
case WrongKind
The path does not resolve to an allowed regular file or required directory.
case AlreadyExists
Exclusive creation found an existing entry.
case Closed
The stream is closed or its owning invocation has ended.
case InvalidRange
The buffer offset or count is negative or outside the array.
case LimitExceeded
The request exceeds a transfer or resource limit.
case WrongAccess
The internal resource has the wrong access direction; directional wrappers do not normally expose this case.
case IoFailure
Another host I/O error occurred.
case InvalidEncoding
The selected encoding cannot encode the supplied text.
case InvalidData
Malformed or truncated binary content, including gzip checksum and format failures.
case Busy
Another text write, flush or finalization is pending.
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