Skip to content

Commit

Permalink
Throw exception from SafHelper#findFileBlocking so RetryBackend can w…
Browse files Browse the repository at this point in the history
…ork with it
  • Loading branch information
grote committed Jan 7, 2025
1 parent 40def41 commit 122a5e6
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,12 @@ public fun getTreeDocumentFile(
* when querying for a specific file in a directory,
* so there is no point in trying to optimize the query by not listing all children.
*/
@Throws(IOException::class)
public suspend fun DocumentFile.findFileBlocking(
context: Context,
displayName: String,
): DocumentFile? {
val files = try {
listFilesBlocking(context)
} catch (e: IOException) {
Log.e(TAG, "Error finding file blocking", e)
return null
}
val files = listFilesBlocking(context)
for (doc in files) {
if (displayName == doc.name) return doc
}
Expand Down

0 comments on commit 122a5e6

Please sign in to comment.