DownloadError constructor
DownloadError({
- required String remotePath,
- required DownloadErrorCode code,
- required String message,
Represents a failure that occurred during the file download process from a remote storage source (e.g. Firebase Storage).
Each instance captures:
- remotePath: the path of the file in remote storage.
- code: a specific DownloadErrorCode describing the type of failure.
- message: an optional human-readable description of the error.
This class is used by download managers or error handlers to track, log, or react to failed download attempts.
Example:
final error = DownloadError(
remotePath: 'files/user/avatar.png',
code: DownloadErrorCode.networkError,
message: 'No internet connection',
);
print(error); // DownloadError(remotePath: files/user/avatar.png): errorCode: networkError => message: No internet connection
Implementation
DownloadError({required this.remotePath, required this.code, required this.message});