Skip to content

Commit

Permalink
CORE-20803: Catch IllegalArgumentException when changeParentGroup cau…
Browse files Browse the repository at this point in the history
…ses circular hierarchy (#6306)
  • Loading branch information
Tom-Fitzpatrick authored Jul 25, 2024
1 parent 583dfe3 commit 4dc2991
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import net.corda.lifecycle.createCoordinator
import net.corda.permissions.management.PermissionManagementService
import net.corda.rest.PluggableRestResource
import net.corda.rest.exception.ExceptionDetails
import net.corda.rest.exception.InvalidInputDataException
import net.corda.rest.exception.ResourceNotFoundException
import net.corda.rest.response.ResponseEntity
import net.corda.rest.security.CURRENT_REST_CONTEXT
Expand Down Expand Up @@ -71,6 +72,14 @@ class GroupEndpointImpl @Activate constructor(
e::class.java.simpleName,
ExceptionDetails(e::class.java.name, e.message ?: "No resource found for this request.")
)
} catch (e: IllegalArgumentException) {
throw InvalidInputDataException(
title = e::class.java.simpleName,
exceptionDetails = ExceptionDetails(
e::class.java.name,
e.message ?: "Invalid argument in request."
)
)
}
}

Expand Down

0 comments on commit 4dc2991

Please sign in to comment.