Commit 5b266993 by Nepxion

优化异常抛出

parent cb7be89c
......@@ -15,7 +15,6 @@ import io.swagger.annotations.ApiParam;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
......@@ -104,7 +103,7 @@ public class ConfigEndpoint implements MvcEndpoint {
public ResponseEntity<?> view() {
RuleEntity ruleEntity = ruleCache.get(PluginConstant.RULE);
if (ruleEntity == null) {
return new ResponseEntity<>(Collections.singletonMap("Message", "No config to view"), HttpStatus.OK);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("No config to view");
}
String content = ruleEntity.getContent();
......
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