File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/droplet Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,12 @@ class ControllerDropletService(private val dropletRepository: DropletRepository)
2929 }
3030
3131 override suspend fun registerDroplet (request : RegisterDropletRequest ): RegisterDropletResponse {
32- dropletRepository.find(request.definition.type, request.definition.id)
33- ? : throw StatusException (Status .NOT_FOUND .withDescription(" This Droplet does not exist" ))
3432 val droplet = Droplet .fromDefinition(request.definition)
35-
3633 try {
34+ dropletRepository.delete(droplet)
3735 dropletRepository.save(droplet)
3836 } catch (e: Exception ) {
39- throw StatusException (Status .INTERNAL .withDescription(" Error whilst updating Droplet" ).withCause(e))
37+ throw StatusException (Status .INTERNAL .withDescription(" Error whilst registering Droplet" ).withCause(e))
4038 }
4139 return registerDropletResponse { this .definition = droplet.toDefinition() }
4240 }
You can’t perform that action at this time.
0 commit comments