lib/gcli/commands/server/server.js
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);
  }
}
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);
  }
}
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 ) ; } }
A wrapper around JSON.stringify to fail gracefully
A wrapper around JSON . stringify to fail gracefully