Put the "No Org/Space" message constant where it belongs
This commit is contained in:
@@ -15,12 +15,14 @@ package org.springframework.ide.vscode.commons.cloudfoundry.client.cftarget;
|
||||
*
|
||||
*/
|
||||
public interface CFParamsProviderMessages {
|
||||
|
||||
|
||||
|
||||
|
||||
String noTargetsFound();
|
||||
|
||||
|
||||
String unauthorised();
|
||||
|
||||
|
||||
String noNetworkConnection();
|
||||
|
||||
String noOrgSpace();
|
||||
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class CfCliParamsProvider implements ClientParamsProvider {
|
||||
String orgName = (String) orgFields.get(NAME);
|
||||
String spaceName = (String) spaceFields.get(NAME);
|
||||
if (!StringUtil.hasText(orgName) || !StringUtil.hasText(spaceName)) {
|
||||
throw new NoTargetsException("No org/space selected: Use CF CLI to login");
|
||||
throw new NoTargetsException(getMessages().noOrgSpace());
|
||||
}
|
||||
params.add(new CFClientParams(target, null, credentials, orgName, spaceName, sslDisabled));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public final class CfCliProviderMessages implements CFParamsProviderMessages {
|
||||
*/
|
||||
public static final String NO_CLI_TARGETS_FOUND_MESSAGE = "No Cloud Foundry targets found: Use cf CLI to login";
|
||||
public static final String NO_NETWORK_CONNECTION = "No connection to Cloud Foundry: Use cf CLI to login or verify network connection";
|
||||
public static final String NO_ORG_SPACE = "No org/space selected: Use CF CLI to login";
|
||||
|
||||
@Override
|
||||
public String noTargetsFound() {
|
||||
@@ -35,4 +36,9 @@ public final class CfCliProviderMessages implements CFParamsProviderMessages {
|
||||
public String noNetworkConnection() {
|
||||
return NO_NETWORK_CONNECTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String noOrgSpace() {
|
||||
return NO_ORG_SPACE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user