fix: Catch insufficient-storage errors (#2422)

* fix: Catch `insufficient-storage` errors

* feat: Implement `insufficient-storage` error for Android

* fix: Catch insufficient storage error also on takePhoto android
This commit is contained in:
Marc Rousavy
2024-01-24 11:48:38 +01:00
committed by GitHub
parent 7894779094
commit b1fa06514f
10 changed files with 59 additions and 14 deletions

View File

@@ -180,6 +180,7 @@ enum CaptureError {
case videoNotEnabled
case photoNotEnabled
case aborted
case insufficientStorage
case unknown(message: String? = nil)
var code: String {
@@ -198,6 +199,8 @@ enum CaptureError {
return "video-not-enabled"
case .photoNotEnabled:
return "photo-not-enabled"
case .insufficientStorage:
return "insufficient-storage"
case .aborted:
return "aborted"
case .unknown:
@@ -223,6 +226,8 @@ enum CaptureError {
return "Photo capture is disabled! Pass `photo={true}` to enable photo capture."
case .aborted:
return "The capture has been stopped before any input data arrived."
case .insufficientStorage:
return "There is not enough storage space available."
case let .unknown(message: message):
return message ?? "An unknown error occured while capturing a video/photo."
}