code: function stringify(data, action) {
    try {
      return JSON.stringify(data);
    }
    catch (ex) {
      console.error('Performing "' + action + '". Failed to stringify', data);
      util.errorHandler(ex);
  
      data = {
        code: -1,
        data: ex.toString()
      };
      return JSON.stringify(data);
    }
  }
docs: A wrapper around JSON.stringify to fail gracefully