Skip to content

Commit b5fc999

Browse files
Deprecation warning explanation added (MrRefactoring#211)
1 parent c361612 commit b5fc999

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Usability, consistency, and performance are key focuses of jira.js, and it also
1919

2020
- [Installation](#installation)
2121
- [Documentation](#documentation)
22+
- [Deprecation warnings](#deprecation-warnings)
2223
- [Usage](#usage)
2324
- [Authentication](#authentication)
2425
- [Basic](#basic-authentication)
@@ -51,6 +52,54 @@ yarn add jira.js
5152

5253
You can find the documentation [here](https://mrrefactoring.github.io/jira.js/).
5354

55+
## Deprecation warnings
56+
57+
1. Deprecation warning: New error handling mechanism added. Please use `newErrorHandling: true` in config
58+
> We are using a new error handling mechanism (instead throwing raw axios error will be showed API response). For enable it, make following changes in your config:
59+
> ```ts
60+
> const client = new Version3Client({
61+
> host: '...',
62+
> newErrorHandling: true, // This flag enable new error handling.
63+
> });
64+
>
65+
> // Examples
66+
>
67+
> /** Old error handling **/
68+
>
69+
> const client = new Version3Client({ host: '...' });
70+
>
71+
> client.issues.createIssue();
72+
>
73+
> // Output:
74+
> // {
75+
> // code: 'ERR_BAD_REQUEST',
76+
> // config: { a lot of stuff here },
77+
> // request: { a lot of stuff here },
78+
> // response: {
79+
> // a lot of stuff here
80+
> // data: {
81+
> // errorMessages: [],
82+
> // errors: { project: 'Specify a valid project ID or key' }
83+
> // },
84+
> // a lot of stuff here
85+
> // },
86+
> // a lot of stuff here
87+
> // }
88+
>
89+
> /** New error handling **/
90+
>
91+
> const client = new Version3Client({ host: '...', newErrorHandling: true });
92+
>
93+
> client.issues.createIssue();
94+
>
95+
> // Output:
96+
> // {
97+
> // errorMessages: [],
98+
> // errors: { project: 'Specify a valid project ID or key' }
99+
> // }
100+
> ```
101+
102+
54103
## Usage
55104
56105
#### Authentication

0 commit comments

Comments
 (0)