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

commonMain.aws.sdk.kotlin.services.route53.serde.XmlErrorUtils.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.route53.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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy