MediaException constructor

MediaException({
  1. required MediaOperationType type,
  2. required String mediaType,
  3. String? path,
  4. String? mimeType,
  5. int? fileSize,
  6. String? code,
  7. dynamic details,
  8. Object? cause,
  9. StackTrace? stack,
  10. bool isRetryable = true,
  11. 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,
        },
      );