Union
FileReadError
union struct FileReadError
Module: System.Storage
Assembly: System.Runtime.dll
Source file: FileReadError.rvn
Inheritance: Object → ValueType → FileReadError
Implements: Error
Expected failures from the static native whole-text file helper.
Remarks
Construct a named case; an uninitialized carrier is not a valid error. These legacy error families are distinct from StreamError and StorageLookupError. Use named case patterns. The default union is inactive: HasValue is false, Value is null and ToString returns Empty.
Cases
8 cases
case InvalidLimit
The byte limit is negative.
case InvalidPath
The native path is empty or contains NUL.
case NotFound
The file or a required parent cannot be found.
case AccessDenied
The host denied access.
case NotRegularFile
The target is not a regular file.
case TooLarge
The file or encoded text exceeds the byte limit.
case ReadFailed
A remaining native read failure occurred.
case InvalidUtf8
File bytes are not valid UTF-8.
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<FileReadError>
Adds context, optionally capturing once at this boundary when no cause trace exists.
Extension from ErrorExtensions.WithContext
Extension member:
WithContext(message: string) -> ContextError<FileReadError>
Adds context using the application capture setting (disabled by default).
Extension from ErrorExtensions.WithContext