commonMain.aws.sdk.kotlin.services.redshift.serde.XmlErrorUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshift-jvm Show documentation
Show all versions of redshift-jvm Show documentation
The AWS SDK for Kotlin client for Redshift
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshift.serde
import aws.smithy.kotlin.runtime.serde.DeserializationException
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
/**
* Handle [wrapped](https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html#error-response-serialization) error responses
*/
internal fun unwrapWrappedXmlErrorResponse(root: XmlTagReader): XmlTagReader {
if (root.tagName != "ErrorResponse") {
throw DeserializationException("invalid root, expected ; found `${root.tag}`")
}
val errTag = root.nextTag()
if (errTag == null || errTag.tagName != "Error") {
throw DeserializationException("invalid error, expected ; found `${errTag?.tag}`")
}
return errTag
}