mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-20 23:45:55 +08:00
better code
This commit is contained in:
parent
73a7eda990
commit
09dbd219c2
|
@ -88,9 +88,12 @@ public class ApiGateway extends Controll {
|
|||
Application.getSessionStore().clean();
|
||||
}
|
||||
|
||||
JSON err = formatFailure(errorMsg == null ? "Server Internal Error" : errorMsg, errorCode);
|
||||
JSON err = formatFailure(StringUtils.defaultIfBlank(errorMsg, "Server Internal Error"), errorCode);
|
||||
ServletUtils.writeJson(response, err.toJSONString());
|
||||
logRequestAsync(reuqestTime, remoteIp, apiName, context, err);
|
||||
try {
|
||||
logRequestAsync(reuqestTime, remoteIp, apiName, context, err);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,7 +232,7 @@ public class ApiGateway extends Controll {
|
|||
BaseApi api = (BaseApi) ReflectUtils.newInstance(clazz);
|
||||
String apiName = api.getApiName();
|
||||
if (API_CLASSES.containsKey(apiName)) {
|
||||
LOG.warn("Replaced API : " + apiName);
|
||||
LOG.error("Replaced API : " + apiName);
|
||||
}
|
||||
|
||||
API_CLASSES.put(apiName, clazz);
|
||||
|
|
Loading…
Reference in a new issue