@jetthai/cuora 1.1.307-dev-2 → 1.1.307-dev-3
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.
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/src/request/request.js +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.307-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.307-dev-2...v1.1.307-dev-3) (2024-09-19)
|
|
6
|
+
|
|
5
7
|
### [1.1.307-dev-2](https://github.com/jetthai/cuora-module/compare/v1.0.307-dev-2...v1.1.307-dev-2) (2024-09-19)
|
|
6
8
|
|
|
7
9
|
### [1.0.307-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.307-dev-1...v1.0.307-dev-2) (2024-09-19)
|
package/package.json
CHANGED
package/src/request/request.js
CHANGED
|
@@ -12,6 +12,7 @@ export default class Request {
|
|
|
12
12
|
this.axios = axios
|
|
13
13
|
this.source = axios.CancelToken.source()
|
|
14
14
|
this.config = config
|
|
15
|
+
this.sentry = config.sentry
|
|
15
16
|
this.key = `cuora_${config.clientId}`
|
|
16
17
|
this.errorHandler = null
|
|
17
18
|
this.hosts = []
|
|
@@ -35,8 +36,17 @@ export default class Request {
|
|
|
35
36
|
}
|
|
36
37
|
return Promise.resolve(response)
|
|
37
38
|
},
|
|
38
|
-
|
|
39
|
+
(error) => {
|
|
39
40
|
if (error.message === 'Network Error' || error.message === 'Request failed with status code 404') {
|
|
41
|
+
const errData = (error || {}).response || {}
|
|
42
|
+
const errorDetails = {
|
|
43
|
+
data: errData.config?.data,
|
|
44
|
+
params: errData.config?.params,
|
|
45
|
+
url: errData.config?.url,
|
|
46
|
+
status: errData.status,
|
|
47
|
+
}
|
|
48
|
+
console.log('ERR_998 details:', errorDetails)
|
|
49
|
+
this.sentry?.captureException(`ERR_998:${error.message}`)
|
|
40
50
|
return Promise.reject({ code: 'ERR_998' })
|
|
41
51
|
}
|
|
42
52
|
return Promise.reject(error.response?.data?.error || error)
|