kintoneAPIException
Handle error responses from kintone Rest API
Methods
get()
Parameter
(none)
Return
Sample code
Get app with error response
Source code
let appID = {your_invalid_app_id};
kintoneApp.getApp(appID)
.catch((err) => {
// This SDK return err with KintoneAPIExeption
console.log(err.get());
});
Response
{
"message":"{kintone_error_message}",
"id":"kintone_error_id",
"code":"{kintone_error_code}"
}
// In the some case, the kintone Rest API will response with detail errors
{
"message":"{kintone_error_message}",
"id":"kintone_error_id",
"code":"{kintone_error_code}",
"errors": [
/*errors items here*/
]
}
getAll()
Parameter
(none)
Return
The result of Promise.Reject()
Sample code
Get apps with error response
Source code
let appID = {your_invalid_app_id};
kintoneApp.getApp(appID)
.catch((err) => {
// This SDK return err with KintoneAPIExeption
console.log(err.getAll());
});
throw()
This function will throw result of get() function
Parameter
(none)
Return
(none)
throwAll()
This function will throw result of getAll() function
Parameter
(none)
Return
(none)
Reference
- kintone REST API Overview
on developer network
- request-promise
on npmjs