@availity/exceptions-axios 3.0.64 → 3.0.68
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 +32 -0
- package/README.md +9 -12
- package/package.json +17 -12
- package/tests/exceptionsAxios.test.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.68](https://github.com/Availity/sdk-js/compare/@availity/exceptions-axios@3.0.67...@availity/exceptions-axios@3.0.68) (2022-01-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @availity/exceptions-axios
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 3.0.67 (2021-12-21)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @availity/exceptions-axios
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.0.66](https://github.com/Availity/sdk-js/compare/@availity/exceptions-axios@3.0.65...@availity/exceptions-axios@3.0.66) (2021-10-29)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @availity/exceptions-axios
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [3.0.65](https://github.com/Availity/sdk-js/compare/@availity/exceptions-axios@3.0.64...@availity/exceptions-axios@3.0.65) (2021-10-22)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @availity/exceptions-axios
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## 3.0.64 (2021-10-20)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @availity/exceptions-axios
|
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @availity/exceptions-axios
|
|
2
2
|
|
|
3
3
|
> A package wrapping the Exceptions class to use axios. Using avLogMessagesApi to log errors.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@availity/exceptions-axios)
|
|
6
|
+
[](https://www.npmjs.com/package/@availity/exceptions-axios)
|
|
7
|
+
[](https://github.com/Availity/sdk-js/blob/master/packages/exceptions-axios/package.json)
|
|
6
8
|
|
|
7
9
|
More details about configuration can be found in [Exceptions-Core](../exceptions-core)
|
|
8
10
|
|
|
@@ -20,13 +22,15 @@ npm install @availity/exceptions-axios
|
|
|
20
22
|
yarn add @availity/exceptions-axios
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
Add module to your app.
|
|
24
28
|
|
|
25
29
|
```js
|
|
26
30
|
import avExceptionsAxios from '@availity/exceptions-axios';
|
|
27
31
|
```
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
Configure the default options
|
|
30
34
|
|
|
31
35
|
```js
|
|
32
36
|
import avExceptionsAxios from '@availity/exceptions-axios';
|
|
@@ -34,7 +38,6 @@ import avExceptionsAxios from '@availity/exceptions-axios';
|
|
|
34
38
|
avExceptionsAxios.enabled(false); // enabled defaults to true... this example would disable it
|
|
35
39
|
avExceptionsAxios.appId('exampleApp'); // if undefined, logs 'N/A'
|
|
36
40
|
avExceptionsAxios.repeatTime(5000); // sets the time in ms between logging calls for the same error message. (default 5 seconds)
|
|
37
|
-
});
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
It will automatically catch all error which bubble up to the window (error which are not caught and handled in code) and log those errors. So as long as you are not catching your error you should be able to throw and error to log it.
|
|
@@ -43,9 +46,8 @@ It will automatically catch all error which bubble up to the window (error which
|
|
|
43
46
|
// this import doesn't need to be on every file, just needs to be imported once somewhere like the main index.js or App.js
|
|
44
47
|
import avExceptionsAxios from '@availity/exceptions-axios';
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
// ... somewhere when something happened
|
|
47
50
|
throw new Error('As long as this error is not caught it will be logged');
|
|
48
|
-
});
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
Or you can manually log and error in the case where something is catching and handling errors before they bubble to the window:
|
|
@@ -53,11 +55,6 @@ Or you can manually log and error in the case where something is catching and ha
|
|
|
53
55
|
```js
|
|
54
56
|
import avExceptionsAxios from '@availity/exceptions-axios';
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
// ... somewhere when something happened
|
|
57
59
|
avExceptionsAxios.submitError(new Error('Manually logging this error'));
|
|
58
|
-
});
|
|
59
60
|
```
|
|
60
|
-
|
|
61
|
-
## License
|
|
62
|
-
|
|
63
|
-
[MIT](../../LICENSE)
|
package/package.json
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/exceptions-axios",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.68",
|
|
4
4
|
"description": "Availity class to log exceptions via axios",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Evan Sharp <evan.sharp@availity.com>",
|
|
5
7
|
"main": "lib/index.js",
|
|
6
8
|
"module": "src/index.js",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "yarn clean && yarn transpile",
|
|
11
|
+
"clean": "rimraf ./lib",
|
|
12
|
+
"transpile": "babel --root-mode upward src -d lib --ignore **/*.test.js"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@babel/runtime": "^7.16.5",
|
|
16
|
+
"core-js": "^3.12.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@availity/api-axios": "^6.0.7",
|
|
20
|
+
"@availity/exceptions-core": "^3.0.23"
|
|
21
|
+
},
|
|
9
22
|
"peerDependencies": {
|
|
10
23
|
"@availity/api-axios": "^4.0.0",
|
|
11
24
|
"@availity/exceptions-core": "^2.6.1"
|
|
12
25
|
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@availity/api-axios": "^6.0.3",
|
|
15
|
-
"@availity/exceptions-core": "^3.0.21"
|
|
16
|
-
},
|
|
17
26
|
"publishConfig": {
|
|
18
27
|
"access": "public"
|
|
19
28
|
},
|
|
20
|
-
"gitHead": "
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@babel/runtime": "^7.10.2",
|
|
23
|
-
"core-js": "^3.12.1"
|
|
24
|
-
}
|
|
29
|
+
"gitHead": "a4839bca214f155b234303dce90c2169c4ed52fa"
|
|
25
30
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import AvExceptionsCore from '@availity/exceptions-core';
|
|
2
|
-
import { avLogMessagesApi } from '@availity/api-axios';
|
|
3
|
-
import avExceptionsAxios from '../src/index';
|
|
4
|
-
|
|
5
|
-
describe('AvExceptionsAxios', () => {
|
|
6
|
-
test('avExceptionsAxios be an instance of AvExceptionsCore', () => {
|
|
7
|
-
expect(avExceptionsAxios).toBeInstanceOf(AvExceptionsCore);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
test('avExceptionsAxios should be api-axios avLogMessagesApi error function', () => {
|
|
11
|
-
expect(avExceptionsAxios.log).toBe(avLogMessagesApi.error);
|
|
12
|
-
});
|
|
13
|
-
});
|