q-koa 8.9.4 → 8.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,7 +100,14 @@ module.exports = class Singleton {
100
100
  return cache.get(appid)
101
101
  }
102
102
  const url = util.format(getAccessTokenUrl, grant_type, appid, secrect)
103
- const { access_token } = await axios.get(url).then((res) => res.data)
103
+
104
+ const result = await axios.get(url).then((res) => res.data)
105
+ const { errcode, errmsg, access_token } = result
106
+
107
+ if (errcode) {
108
+ throw new Error(errmsg)
109
+ }
110
+
104
111
  cache.set(appid, access_token)
105
112
  return access_token
106
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.9.4",
3
+ "version": "8.9.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {