Skip to content
Permalink
Browse files

Change error tips of halo admin updation

  • Loading branch information...
JohnNiang committed Jun 12, 2019
1 parent c7de788 commit b01f04c5474d41f81ab21c46633c936ac76360b0
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/main/java/run/halo/app/service/impl/AdminServiceImpl.java
@@ -244,7 +244,8 @@ public void updateAdminAssets() {
if (responseEntity == null ||
responseEntity.getStatusCode().isError() ||
responseEntity.getBody() == null) {
throw new ServiceException("Failed to request remote url: " + HALO_ADMIN_RELEASES_LATEST).setErrorData(HALO_ADMIN_RELEASES_LATEST);
log.debug("Failed to request remote url: [{}]", HALO_ADMIN_RELEASES_LATEST);
throw new ServiceException("系统无法访问到 Github 的 API").setErrorData(HALO_ADMIN_RELEASES_LATEST);
}

Object assetsObject = responseEntity.getBody().get("assets");
@@ -284,10 +285,11 @@ public void updateAdminAssets() {
// Copy it to template/admin folder
FileUtils.copyFolder(FileUtils.tryToSkipZipParentFolder(assetTempPath), adminPath);
} catch (Throwable t) {
throw new ServiceException(t.getMessage(), t);
log.error("Failed to update halo admin", t);
throw new ServiceException("更新 Halo admin 失败");
}
} else {
throw new ServiceException("Github response error").setErrorData(assetsObject);
throw new ServiceException("Github API 返回内容有误").setErrorData(assetsObject);
}
}

0 comments on commit b01f04c

Please sign in to comment.
You can’t perform that action at this time.