For instance
new RuntimeException(
"Switch space `"
+ config.getSpaceName()
+ "' failed: "
+ resultSet.getErrorMessage());
If this was a NoSpaceFoundException it would be easier to test. Frequently we'd like know if an exception is one we can retry so having ones that implement TransitentException or some ClientException is helpful.
For instance this NoSpaceFoundException is not retryable.