Commit 8f0a300c by lepdou

change argument check exception

parent fc369a00
...@@ -25,7 +25,8 @@ public class ConfigController { ...@@ -25,7 +25,8 @@ public class ConfigController {
@PathVariable long versionId) { @PathVariable long versionId) {
if (Strings.isNullOrEmpty(appId) || Strings.isNullOrEmpty(env)) { if (Strings.isNullOrEmpty(appId) || Strings.isNullOrEmpty(env)) {
throw new NotFoundException(); throw new IllegalArgumentException(
String.format("app id and env can not be empty. app id:%s , env:%s", appId, env));
} }
Apollo.Env e = Apollo.Env.valueOf(env); Apollo.Env e = Apollo.Env.valueOf(env);
......
...@@ -24,8 +24,9 @@ public class VersionController { ...@@ -24,8 +24,9 @@ public class VersionController {
@RequestMapping("/{appId}/{env}") @RequestMapping("/{appId}/{env}")
public List<VersionDTO> versions(@PathVariable String appId, @PathVariable String env) { public List<VersionDTO> versions(@PathVariable String appId, @PathVariable String env) {
if (Strings.isNullOrEmpty(appId) || Strings.isNullOrEmpty(env)){ if (Strings.isNullOrEmpty(appId) || Strings.isNullOrEmpty(env)) {
return Collections.EMPTY_LIST; throw new IllegalArgumentException(
String.format("app id and env can not be empty. app id:%s , env:%s", appId, env));
} }
return versionService.findVersionsByApp(Apollo.Env.valueOf(env), appId); return versionService.findVersionsByApp(Apollo.Env.valueOf(env), appId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment