/** * Detect Appwrite errors when a collection/database resource is missing. */ export function isAppwriteCollectionMissing(err) { if (!err) return false const msg = typeof err.message === 'string' ? err.message : '' return ( err.code === 404 || err.type === 'collection_not_found' || msg.includes('Collection with the requested ID') ) }