Skip to content

Commit

Permalink
fix(swift): cleaner handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluf22 committed Sep 4, 2024
1 parent 1594681 commit d3f7b04
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,8 @@ public extension SearchClient {
func indexExists(indexName: String) async throws -> Bool {
do {
_ = try await self.getSettings(indexName: indexName)
} catch let AlgoliaError.httpError(error) {
if error.statusCode == 404 {
return false
}

throw AlgoliaError.httpError(error)
} catch let AlgoliaError.httpError(error) where error.statusCode == 404 {
return false
}

return true
Expand Down

0 comments on commit d3f7b04

Please sign in to comment.