Skip to content

Commit

Permalink
Improves code formatting (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs committed Jun 15, 2023
1 parent ced4091 commit cba8ddb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Tartelet/Sources/Composition/EphemeralVirtualMachineFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ struct EphemeralVirtualMachineFactory: VirtualMachineFactory {
logger.error("Failed making ephemeral virtual machine as name is not available")
throw EphemeralVirtualMachineFactoryError.sourceVirtualMachineNameUnavailable
}
let resourcesService = resourcesServiceFactory.makeService(virtualMachineName: name)
do {
let resourcesService = resourcesServiceFactory.makeService(virtualMachineName: name)
try await resourcesService.createResourcesIfNeeded()
// swiftlint:disable:next trailing_closure
return EphemeralTartVirtualMachine(
tart: tart,
sourceVMName: sourceVMName,
destinationVMName: name,
resourcesDirectoryURL: resourcesService.directoryURL,
onCleanup: {
do {
try resourcesService.removeResources()
} catch {
logger.error("Failed cleaning up resources for ephemeral virtual machine: \(error.localizedDescription, privacy: .public)")
}
})
} catch {
logger.error("Failed making ephemeral virtual machine as resources could not be created: \(error.localizedDescription, privacy: .public)")
throw error
}
// swiftlint:disable:next trailing_closure
return EphemeralTartVirtualMachine(
tart: tart,
sourceVMName: sourceVMName,
destinationVMName: name,
resourcesDirectoryURL: resourcesService.directoryURL,
onCleanup: {
do {
try resourcesService.removeResources()
} catch {
logger.error("Failed cleaning up resources for ephemeral virtual machine: \(error.localizedDescription, privacy: .public)")
}
})
}
}

0 comments on commit cba8ddb

Please sign in to comment.