All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.xebia.functional.openai.errors.ResponseSerializerErrors.kt Maven / Gradle / Ivy

There is a newer version: 0.0.5-alpha.118
Show newest version
package com.xebia.functional.openai.errors

import io.ktor.client.call.*
import io.ktor.client.statement.*

suspend inline fun  HttpResponse.serializeOrThrowWithResponseInfo(): A =
  try {
    this.body() ?: throw ResponseSerializerError("Response body is null")
  } catch (e: Exception) {
    throw ResponseSerializerError("Failed to deserialize response body:\n${bodyAsText()}", e)
  }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy