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

@@ -84,7 +84,11 @@ class PhotoCaptureDelegate: NSObject, AVCapturePhotoCaptureDelegate {
delegatesReferences.removeAll(where: { $0 == self })
}
if let error = error as NSError? {
promise.reject(error: .capture(.unknown(message: error.description)), cause: error)
if error.code == -11807 {
promise.reject(error: .capture(.insufficientStorage), cause: error)
} else {
promise.reject(error: .capture(.unknown(message: error.description)), cause: error)
}
return
}
}