Example of working error:
spark.personGet('Y2lzY29zcGFyaMWU4LWI1MzQtZDM3YjY1MzYzNjhl]', '1234')
.then(result => {
console.log('Good:', result);
})
.catch(error => {
console.log(JSON.stringify(error, null, 2)); // { "code": 404, "type": "ERR_STATUS" }
console.log(typeof error); // object
console.log('Array? ', Array.isArray(error)); // false
console.log(error); { [Error: recieved error 404 for a GET request to https://api.ciscospark.com/v1/people/Y2lzY29zcGFyaMWU4LWI1MzQtZDM3YjY1MzYzNjhl] code: 404, type: 'ERR_STATUS'
})
membershipAdd result error not an object
spark.membershipAdd(spaceId, '1234')
.then(result => {
console.log('Good:', result);
})
.catch(error => {
console.log(JSON.stringify(error, null, 2)); // {}
console.log(typeof error); // object
console.log(Array.isArray(error)); //false
console.log(error); // [Error: invalid arguments]
})
Sorry that I did not have the time to dig further.
Example of working error:
membershipAdd result error not an object
Sorry that I did not have the time to dig further.