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:
@@ -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."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user