Skip to content

Commit

Permalink
Merge pull request #405 from terwer/dev
Browse files Browse the repository at this point in the history
fix: fix http code
  • Loading branch information
terwer authored Dec 16, 2024
2 parents 09c0c15 + f02108c commit eb27ff9
Show file tree
Hide file tree
Showing 9 changed files with 272 additions and 235 deletions.
6 changes: 6 additions & 0 deletions libs/zhi-fetch-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# zhi-fetch-middleware

## 0.13.0

### Minor Changes

- fix http code

## 0.12.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-fetch-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-fetch-middleware",
"version": "0.12.0",
"version": "0.13.0",
"type": "module",
"description": "an intermediate tier prepared for fetch requests",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-fetch-middleware/src/lib/commonFetchClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CommonFetchClient implements ICommonFetchClient {
this.logger.error(`fetch请求错误,code ${statusCode}, body =>`, resBody)
if (statusCode === 400) {
throw new Error("错误请求,服务器不理解请求的语法")
} else if (statusCode === 401) {
} else if (statusCode === 401 || statusCode === 403) {
throw new Error("因权限不足操作已被禁止")
} else if (statusCode > 401) {
if (statusCode === 413) {
Expand Down
11 changes: 11 additions & 0 deletions libs/zhi-gitlab-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# zhi-gitlab-middleware

## 0.11.0

### Minor Changes

- fix http code

### Patch Changes

- Updated dependencies
- zhi-fetch-middleware@0.13.0

## 0.10.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-gitlab-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-gitlab-middleware",
"version": "0.10.0",
"version": "0.11.0",
"type": "module",
"description": "a middleware for gitlab api ",
"main": "./dist/index.js",
Expand Down
16 changes: 12 additions & 4 deletions libs/zhi-gitlab-middleware/src/lib/commonGitlabClient.spec.ts

Large diffs are not rendered by default.

Loading

0 comments on commit eb27ff9

Please sign in to comment.