bug fixes
This commit is contained in:
parent
f2a95e291a
commit
985e3811e3
14 changed files with 758 additions and 78 deletions
|
|
@ -11,12 +11,17 @@ function sendMessage (account, rec) {
|
|||
const body = rec.sms.body
|
||||
const _toNumber = rec.sms.toNumber || account.toNumber
|
||||
|
||||
return client.sendMessage({
|
||||
const opts = {
|
||||
body: body,
|
||||
to: _toNumber,
|
||||
from: account.fromNumber
|
||||
})
|
||||
}
|
||||
|
||||
console.log('DEBUG111: %j', opts)
|
||||
|
||||
return client.sendMessage(opts)
|
||||
.catch(err => {
|
||||
console.log('DEBUG113: %s', err)
|
||||
if (_.includes(err.code, BAD_NUMBER_CODES)) {
|
||||
const badNumberError = new Error(err.message)
|
||||
badNumberError.name = 'BadNumberError'
|
||||
|
|
@ -25,6 +30,7 @@ function sendMessage (account, rec) {
|
|||
|
||||
throw new Error(err.message)
|
||||
})
|
||||
.then(_.tap(() => console.log('DEBUG112')))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue