Enum FileErrorCode
Specifies structured error codes that classify the reason a file I/O operation failed.
Namespace: Scylla.Core.Util.File
Assembly: ScyllaCore.dll
Syntax
public enum FileErrorCode
Remarks
Every FileException carries a FileErrorCode value so callers can
branch on the specific failure category without parsing exception messages. Use this enum
in catch (FileException ex) blocks to determine the appropriate recovery strategy.
Codes are grouped by concern:
- Path validity: NullData, InvalidPath, PathTooLong
- File existence: FileNotFound, DirectoryNotFound, FileExists
- Access and locking: AccessDenied, FileLocked
- Operational: IOError, InsufficientSpace, Timeout, OperationCancelled
- Image-specific: UnsupportedImageFormat, TextureNotReadable, ImageEncodingFailed, ImageDecodingFailed
- Data pipeline: UnsupportedEncoding, SerializationFailed, CompressionFailed, EncryptionFailed
Fields
| Name | Description |
|---|---|
| AccessDenied | The calling process does not have permission to access the file or directory.
On Windows this corresponds to |
| CompressionFailed | The |
| DirectoryNotFound | One or more directories in the specified path do not exist and
CreateDirectories is |
| EncryptionFailed | The |
| FileExists | The destination file already exists and OverwriteExisting
is |
| FileLocked | The file is currently held open by another process or thread in an incompatible share
mode. On Windows this corresponds to |
| FileNotFound | The specified file path does not refer to an existing file. Maps to FileNotFoundException when wrapping a .NET exception. |
| IOError | A low-level I/O error occurred that does not map to a more specific code. The InnerException typically contains a IOException with additional platform-specific details. |
| ImageDecodingFailed | The image decoding step failed. This typically means the file data is corrupt, truncated, or in a format that cannot be decoded by the current Unity codec. |
| ImageEncodingFailed | The image encoding step failed. This may indicate an out-of-memory condition, an unsupported pixel format, or a codec error in the Unity encoder. |
| InsufficientSpace | The target drive or volume does not have enough free space to complete the write or copy operation. |
| InvalidPath | The path string contains characters that are illegal on the current platform, contains
a |
| InvalidSettings | One or more values in the supplied FileSettings are outside their
valid range (for example, BufferSize below
MIN_BUFFER_SIZE or a |
| NullData | A required data argument or path was |
| OperationCancelled | The operation was cancelled via the caller's CancellationToken before it completed. Maps to OperationCanceledException when wrapping a .NET exception. |
| PathTooLong | The full path string exceeds the maximum length allowed by the operating system (260 characters on Windows without long-path support; unlimited on POSIX). Maps to PathTooLongException when wrapping a .NET exception. |
| SerializationFailed | The |
| TextureNotReadable | The |
| Timeout | The operation did not complete within the allotted time. Callers may retry with a longer timeout or a smaller transfer size. |
| Unknown | An unknown or unspecified error occurred. Used as a fallback when no more specific code applies. Inspect InnerException for the underlying cause. |
| UnsupportedEncoding | The requested text encoding is not supported or available on the current platform. Ensure the Encoding property is set to a valid, non-null Encoding instance. |
| UnsupportedImageFormat | The file's format or extension is not among those supported by the image I/O
subsystem. Supported formats are defined by |