Catch crop cancelled errors (#9451)

This commit is contained in:
Samuel Newman
2025-12-02 10:06:12 +02:00
committed by GitHub
parent 507531e1db
commit 4d1b1bb2fd
5 changed files with 35 additions and 11 deletions
+12
View File
@@ -52,3 +52,15 @@ export function isErrorMaybeAppPasswordPermissions(e: unknown) {
const str = String(e)
return str.includes('Bad token scope') || str.includes('Bad token method')
}
/**
* Intended to capture "User cancelled" or "Crop cancelled" errors
* that we often get from expo modules such expo-image-crop-tool
*
* The exact name has changed in the past so let's just see if the string
* contains "cancel"
*/
export function isCancelledError(e: unknown) {
const str = String(e).toLowerCase()
return str.includes('cancel')
}