Skip to content

Commit fae0924

Browse files
author
HelloEdit
committed
chore(readme): more details on the resolved promise
1 parent 3245d73 commit fae0924

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,30 @@ options - Object (optional)
9292

9393
The responses are promise-based, so you you'll need to handle things in a .then() function or `await` if you use ES7.
9494

95+
```js
96+
api.findPages('173')
97+
.then(i => console.log(i))
98+
.catch(console.log)
99+
100+
// or if you are more ES7
101+
102+
try {
103+
const result = await api.findPages('173')
104+
console.log(result.data)
105+
} catch(err) {
106+
// See constant below
107+
console.log(err)
108+
}
109+
```
110+
111+
To see in detail what each method returns, [see this page](https://github.com/FiftyNine/ScpperDB#api).
112+
95113
The promised is resolved if no error has occurred (see below).
96114

97115
```
98116
Constant VALUE Status Code Explanation
99117
----------------------------------------------------------------------------------------
100-
NONE null 200-299 No problems.
118+
NONE null 200-299 No problems. The promise is resolved.
101119
CLIENT_ERROR 'CLIENT_ERROR' 400-499 Any non-specific 400 series error.
102120
SERVER_ERROR 'SERVER_ERROR' 500-599 Any 500 series error.
103121
TIMEOUT_ERROR 'TIMEOUT_ERROR' --- Server didn't respond in time.
@@ -148,4 +166,4 @@ SCP Foundation and all related works were created by SCP creative community and
148166

149167
Thanks to FiftyNine for the API and for his infinite patience during our exchanges !
150168

151-
Thanks also to all my friends of the french Foundation branch <3
169+
Thanks also to all my friends of the french Foundation branch, and for the unconditional love of Boule De Neige <3

0 commit comments

Comments
 (0)