UploadError class
A model representing a failure that occurred during the upload of a specific file.
This class is not an exception but a structured representation of an upload error that can be used for diagnostics, UI feedback, or retry logic.
Each instance contains:
resourceId: the unique ID of the file that failed to upload.- code: the type of error encountered, described by UploadErrorCode.
- message: optional details about the failure for debugging or display.
Example usage:
final error = UploadError(
resourceId: 'file_123',
code: UploadErrorCode.networkFailure,
message: 'No internet connection',
);
print('Failed to upload ${error.resourceId}: ${error.message}');
Constructors
- UploadError({required File file, required UploadErrorCode code, required String message})
-
Creates a new UploadError for a given
file,code, andmessage.
Properties
- code → UploadErrorCode
-
The specific error code describing the cause of the upload failure.
final
- file → File
-
The file that failed to upload.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
Optional human-readable message describing the error.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited