src/main/scala/s3/website/S3.scala in s3_website-2.1.12 vs src/main/scala/s3/website/S3.scala in s3_website-2.1.13

- old
+ new

@@ -1,7 +1,8 @@ package s3.website +import s3.website.ErrorReport.errorMessage import s3.website.model._ import com.amazonaws.services.s3.{AmazonS3, AmazonS3Client} import com.amazonaws.services.s3.model._ import scala.collection.JavaConversions._ import scala.concurrent.{ExecutionContextExecutor, Future} @@ -138,11 +139,11 @@ type S3FilesAndUpdatesFuture = Future[S3FilesAndUpdates] type ErrorOrS3FilesAndUpdates = Future[Either[ErrorReport, S3FilesAndUpdates]] type UpdateFutures = Seq[Either[ErrorReport, Future[PushErrorOrSuccess]]] type ErrorOrS3Files = Either[ErrorReport, Seq[S3File]] - sealed trait PushFailureReport extends FailureReport + sealed trait PushFailureReport extends ErrorReport sealed trait PushSuccessReport extends SuccessReport { def s3Key: String } case class SuccessfulRedirectDetails(uploadType: UploadType, redirectTarget: String) @@ -206,15 +207,15 @@ case class SuccessfulDelete(s3Key: String)(implicit pushMode: PushMode) extends PushSuccessReport { def reportMessage = s"${Deleted.renderVerb} $s3Key" } - case class FailedUpload(s3Key: String, error: Throwable) extends PushFailureReport { - def reportMessage = s"Failed to upload $s3Key (${error.getMessage})" + case class FailedUpload(s3Key: String, error: Throwable)(implicit logger: Logger) extends PushFailureReport { + def reportMessage = errorMessage(s"Failed to upload $s3Key", error) } - case class FailedDelete(s3Key: String, error: Throwable) extends PushFailureReport { - def reportMessage = s"Failed to delete $s3Key (${error.getMessage})" + case class FailedDelete(s3Key: String, error: Throwable)(implicit logger: Logger) extends PushFailureReport { + def reportMessage = errorMessage(s"Failed to delete $s3Key", error) } type S3ClientProvider = (Config) => AmazonS3 case class S3Setting(