-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use internal copy of closeQuietly to avoid location mismatches in OkH…
…TTP versions
- Loading branch information
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
reaper/reaper/src/main/kotlin/com/emergetools/reaper/utils/OkHttpUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.emergetools.reaper.utils | ||
|
||
import java.io.Closeable | ||
|
||
internal object OkHttpUtils { | ||
|
||
// OkHttp moved this extension function in 5.x of the OkHttp library | ||
// To avoid resolution issues, we'll implement this extension internally. | ||
fun Closeable.closeQuietly() { | ||
try { | ||
close() | ||
} catch (rethrown: RuntimeException) { | ||
throw rethrown | ||
} catch (ignored: Exception) { | ||
// Ignored | ||
} | ||
} | ||
} |