@@ -19,7 +19,7 @@ import io.ktor.client.request.put
1919suspend inline fun <reified T > HttpClient.getResult (
2020 urlString : String ,
2121 noinline block : HttpRequestBuilder .() -> Unit = {},
22- ): Result <T > = runCatching { get(urlString, block).body() }
22+ ): Result <T > = runSafeSuspendCatching { get(urlString, block).body() }
2323
2424/* *
2525 * Performs an HTTP POST request synchronously and returns the result as a [Result] of type [T].
@@ -31,7 +31,7 @@ suspend inline fun <reified T> HttpClient.getResult(
3131suspend inline fun <reified T > HttpClient.postResult (
3232 urlString : String ,
3333 noinline block : HttpRequestBuilder .() -> Unit = {},
34- ): Result <T > = runCatching { post(urlString, block).body() }
34+ ): Result <T > = runSafeSuspendCatching { post(urlString, block).body() }
3535
3636/* *
3737 * Performs an HTTP PUT request synchronously and returns the result as a [Result] of type [T].
@@ -43,7 +43,7 @@ suspend inline fun <reified T> HttpClient.postResult(
4343suspend inline fun <reified T > HttpClient.putResult (
4444 urlString : String ,
4545 noinline block : HttpRequestBuilder .() -> Unit = {},
46- ): Result <T > = runCatching { put(urlString, block).body() }
46+ ): Result <T > = runSafeSuspendCatching { put(urlString, block).body() }
4747
4848/* *
4949 * Performs an HTTP DELETE request synchronously and returns the result as a [Result] of type [T].
@@ -55,7 +55,7 @@ suspend inline fun <reified T> HttpClient.putResult(
5555suspend inline fun <reified T > HttpClient.deleteResult (
5656 urlString : String ,
5757 noinline block : HttpRequestBuilder .() -> Unit = {},
58- ): Result <T > = runCatching { delete(urlString, block).body() }
58+ ): Result <T > = runSafeSuspendCatching { delete(urlString, block).body() }
5959
6060/* *
6161 * Performs an HTTP PATCH request synchronously and returns the result as a [Result] of type [T].
@@ -67,7 +67,7 @@ suspend inline fun <reified T> HttpClient.deleteResult(
6767suspend inline fun <reified T > HttpClient.patchResult (
6868 urlString : String ,
6969 noinline block : HttpRequestBuilder .() -> Unit = {},
70- ): Result <T > = runCatching { patch(urlString, block).body() }
70+ ): Result <T > = runSafeSuspendCatching { patch(urlString, block).body() }
7171
7272/* *
7373 * Performs an HTTP HEAD request synchronously and returns the result as a [Result] of type [T].
@@ -79,7 +79,7 @@ suspend inline fun <reified T> HttpClient.patchResult(
7979suspend inline fun <reified T > HttpClient.headResult (
8080 urlString : String ,
8181 noinline block : HttpRequestBuilder .() -> Unit = {},
82- ): Result <T > = runCatching { head(urlString, block).body() }
82+ ): Result <T > = runSafeSuspendCatching { head(urlString, block).body() }
8383
8484/* *
8585 * Performs an HTTP OPTIONS request synchronously and returns the result as a [Result] of type [T].
@@ -91,4 +91,4 @@ suspend inline fun <reified T> HttpClient.headResult(
9191suspend inline fun <reified T > HttpClient.optionsResult (
9292 urlString : String ,
9393 noinline block : HttpRequestBuilder .() -> Unit = {},
94- ): Result <T > = runCatching { options(urlString, block).body() }
94+ ): Result <T > = runSafeSuspendCatching { options(urlString, block).body() }
0 commit comments