Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.send(function (err, res) {
if (err) {
if (err instanceof JPush.APIConnectionError) {
console.log(err.message)
// Response Timeout means your request to the server may have already received,
// please check whether or not to push
console.log(err.isResponseTimeout)
} else if (err instanceof JPush.APIRequestError) {
console.log(err.message)
}
} else {
console.log('Sendno: ' + res.sendno)
console.log('Msg_id: ' + res.msg_id)
}
})
}