MediaException constructor
MediaException({
- required MediaOperationType type,
- required String mediaType,
- String? path,
- String? mimeType,
- int? fileSize,
- String? code,
- dynamic details,
- Object? cause,
- StackTrace? stack,
- bool isRetryable = true,
- bool isReportable = true,
Creates a media exception scoped to the given type and mediaType.
Implementation
MediaException({
required MediaOperationType type,
required this.mediaType,
String? path,
String? mimeType,
int? fileSize,
super.code,
super.details,
super.cause,
super.stack,
bool isRetryable = true,
super.isReportable,
}) : super(
operation: 'media_${type.name}',
userMessage: _userMessage(type),
devMessage: _devMessage(type, path),
severity: _severity(type),
metadata: {
'mediaOperation': type.name,
'mediaType': mediaType,
if (path != null) 'path': path,
if (mimeType != null) 'mimeType': mimeType,
if (fileSize != null) 'fileSize': fileSize,
'isRetryable': isRetryable,
},
);