Skip to content

Commit

Permalink
fix: 修复获取依赖包类型接口报错无捕获;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Aug 16, 2021
1 parent be9c373 commit 43582a5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# [](https://github.com/Maslow/less-framework/compare/v0.4.16...v) (2021-08-16)


### Features

* **app-server:** add cache-control & etag of http request for gridfs files; ([acc3c44](https://github.com/Maslow/less-framework/commit/acc3c440afc55c3666c0bca0661daf9f54bb2fd9))
* **devops-adin:** 优化访问策略编辑页的交互体验、修复修改访问策略时的错误; ([759fe32](https://github.com/Maslow/less-framework/commit/759fe32c7f679274a660d47f27c62ceb6356e875))



## [0.4.16](https://github.com/Maslow/less-framework/compare/v0.4.15...v0.4.16) (2021-08-13)


### Features

* 新增 GridFS 文件存储方式; ([0ddc915](https://github.com/Maslow/less-framework/commit/0ddc9151a437fe7be17c5eae972a0786a6966c38))



## [0.4.15](https://github.com/Maslow/less-framework/compare/v0.4.14...v0.4.15) (2021-08-10)

Expand Down
32 changes: 15 additions & 17 deletions packages/app-server/src/router/typing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,19 @@ PackageTypingRouter.get('/package', async (req, res) => {
})
}

// 获取其它三方包类型
const pkd = new PackageDeclaration(packageName, nodeModulesRoot)
await pkd.load()
return res.send({
code: 0,
data: pkd.declarations
})
try {
// 获取其它三方包类型
const pkd = new PackageDeclaration(packageName, nodeModulesRoot)
await pkd.load()
return res.send({
code: 0,
data: pkd.declarations
})
} catch (error) {
logger.error(requestId, 'failed to get package typings', error)
return res.send({
code: 1,
error: error.toString()
})
}
})



// /**
// * 获取 node 所有官方包的声明文件
// */
// async function getAllNodeBuiltinPackages() {
// const pkr = new NodePackageDeclarations(nodeModulesRoot)

// }

0 comments on commit 43582a5

Please sign in to comment.