<commit_before>var config = require('../config')
var client = require('twilio')(config.accountSid, config.authToken)
const errors = require('./errors')

module.exports.sendSmsPromise = function (data, to, message) {
  console.log('smsprocessor1')
  console.log(message)
  return client.messages.create({body: message, to: to, from: config.sendingNumber})
    .then(result => {
      console.log('smsprocessor2')
      console.log(result)
      return data
    }, err => {
      console.log('smsprocessor3')
      console.log(err)
      data.systemError = err
      data.errorMessage = errors.errorTypes.smsError<commit_msg>better logging<commit_after>var config = require('../config')
var client = require('twilio')(config.accountSid, config.authToken)
const errors = require('./errors')

module.exports.sendSmsPromise = function (data, to, message) {
  console.log('smsprocessor1')
  console.log(message)
  const params = {body: message, to: to, from: config.sendingNumber}
  return client.messages.create(params)
    .then(result => {
      console.log('smsprocessor2')
      console.log(params)
      return data
    }, err => {
      console.log('smsprocessor3')
      console.log(err)
      data.systemError = err
      data.errorMessage = errors.errorTypes.smsError
{'fraction_non_alphanumeric': 0.13926042486231313, 'fraction_numerical': 0.004720692368214005, 'mean_word_length': 3.854961832061069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1636326', 'n_tokens_mistral': 387, 'n_tokens_neox': 385, 'n_words': 75}