Skip to content

Commit cb40de1

Browse files
committed
docs(kitsu-core): add examples for error
1 parent 63c15f4 commit cb40de1

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

packages/kitsu-core/src/error/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
*
44
* @param {Object} E The Error
55
* @throws {Object} The mutated Error
6+
*
7+
* @example
8+
* error('Hello')
9+
*
10+
* @example
11+
* error({errors: [ { code: 400 } ]})
12+
*
13+
* @example
14+
* error({
15+
* response: {
16+
* data: {
17+
* errors: [ {
18+
* title: 'Filter is not allowed',
19+
* detail: 'x is not allowed',
20+
* code: '102',
21+
* status: '400'
22+
* } ]
23+
* }
24+
* }
25+
* })
626
*/
727
export function error (E) {
828
if (E.response) {

0 commit comments

Comments
 (0)