Skip to content

Commit

Permalink
feat: 网络请求出错时打印请求地址、请求参数方便排查
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Nov 17, 2022
1 parent 2593aaa commit 043a083
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Expand Up @@ -4,4 +4,3 @@ yarn.lock
pnpm-lock.yaml
lib
dist
*
6 changes: 5 additions & 1 deletion src/Generator.ts
Expand Up @@ -577,7 +577,11 @@ export class Generator {
}>(url, query)
/* istanbul ignore next */
if (res && res.errcode) {
throwError(res.errmsg)
throwError(
`${res.errmsg} [请求地址: ${url}] [请求参数: ${new URLSearchParams(
query,
).toString()}]`,
)
}
return res.data || res
}
Expand Down

0 comments on commit 043a083

Please sign in to comment.