feat: 增加媒体格式校验,支持 JPEG、PNG、GIF、MP4、WebM、WebP 格式
This commit is contained in:
@@ -35,6 +35,7 @@ public enum DuooomiBleError: LocalizedError {
|
||||
case transferFailed(String)
|
||||
case invalidFrame
|
||||
case permissionDenied
|
||||
case unsupportedFormat(String)
|
||||
|
||||
public var errorDescription: String? {
|
||||
switch self {
|
||||
@@ -64,6 +65,8 @@ public enum DuooomiBleError: LocalizedError {
|
||||
return "Invalid protocol frame"
|
||||
case .permissionDenied:
|
||||
return "Bluetooth permission denied"
|
||||
case .unsupportedFormat(let ext):
|
||||
return "Unsupported file format: \(ext). Supported: jpeg, png, gif, mp4, webm, webp"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user