Skip to content

Commit 7fa8290

Browse files
fix code examples
1 parent d47add8 commit 7fa8290

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/examples/functions/create-tag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client
1212
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1313
;
1414

15-
let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', fs.createReadStream(__dirname + '/file.png')));
15+
let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', fs.createReadStream(__dirname + '/file.png'));
1616

1717
promise.then(function (response) {
1818
console.log(response);

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client
1212
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1313
;
1414

15-
let promise = storage.createFile(fs.createReadStream(__dirname + '/file.png')));
15+
let promise = storage.createFile(fs.createReadStream(__dirname + '/file.png'));
1616

1717
promise.then(function (response) {
1818
console.log(response);

lib/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ class Client {
152152
let response = await axios(options);
153153
return response.data;
154154
} catch(error) {
155-
if('response' in error) {
155+
if('response' in error && error.response !== undefined) {
156156
if(error.response && 'data' in error.response) {
157157
if (typeof(error.response.data) === 'string') {
158-
throw new AppwriteException(error.response.data, error.response.status, error.response.data);
158+
throw new AppwriteException(error.response.data, error.response.status, error.response.data);
159159
} else {
160160
throw new AppwriteException(error.response.data.message, error.response.status, error.response.data);
161161
}

0 commit comments

Comments
 (0)