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

akka.stream.alpakka.s3.S3Exception.scala Maven / Gradle / Ivy

Go to download

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.

There is a newer version: 2.0.2
Show newest version
/*
 * Copyright (C) 2016-2018 Lightbend Inc. 
 */

package akka.stream.alpakka.s3

import scala.xml.{Elem, XML}

class S3Exception(val code: String, val message: String, val requestId: String, val hostId: String)
    extends RuntimeException(message) {

  def this(xmlResponse: Elem) =
    this((xmlResponse \ "Code").text,
         (xmlResponse \ "Message").text,
         (xmlResponse \ "RequestID").text,
         (xmlResponse \ "HostID").text)

  def this(response: String) = this(XML.loadString(response))

  override def toString = s"${super.toString} (Code: $code, RequestID: $requestId, HostID: $hostId)"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy