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

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

There is a newer version: 1.3.31
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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