Skip to content

Commit

Permalink
log errors on billing create (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvoet committed Apr 9, 2018
1 parent 655c1e7 commit ccec2ec
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ trait CreatingBillingProjectMonitor extends LazyLogging {

case Seq(RawlsBillingProjectOperationRecord(_, gcsDAO.CREATE_PROJECT_OPERATION, _, true, Some(error), _)) =>
// create project operation finished with an error
logger.debug(s"project ${project.projectName} creation finished with errors: $error")
Future.successful(project.copy(status = CreationStatuses.Error, message = Option(error)))

case operations: Seq[RawlsBillingProjectOperationRecord] if operations.forall(rec => rec.done && rec.errorMessage.isEmpty) =>
Expand All @@ -144,7 +145,9 @@ trait CreatingBillingProjectMonitor extends LazyLogging {
val messages = operations.collect {
case RawlsBillingProjectOperationRecord(_, operationName, _, true, Some(error), _) => s"Failure enabling api $operationName: ${error}"
}
Future.successful(project.copy(status = CreationStatuses.Error, message = Option(messages.mkString("[", "], [", "]"))))
val errorMessage = messages.mkString("[", "], [", "]")
logger.debug(s"errors enabling apis for project ${project.projectName}: $errorMessage")
Future.successful(project.copy(status = CreationStatuses.Error, message = Option(errorMessage)))

case _ =>
// still running
Expand Down

0 comments on commit ccec2ec

Please sign in to comment.