How to use the debug.error function in debug

To help you get started, we’ve selected a few debug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github filerjs / filer / src / filesystem.js View on Github external
return function(transaction, error) {
      debug.error("error: ", error);
      if(transaction && !transaction.error) {
        try {
          transaction.abort();
        } catch(e) {
          // Transaction has is already completed or aborted, this is probably a programming error
          debug.warn("attempt to abort and already completed or aborted transaction");
        }
      }
      if(callback && "function" === typeof callback) {
        callback.call(undefined, error);
      }
    }
  }
github ClementNerma / NightOS-v2 / apps / dolphin / dolphin.js View on Github external
} else {
  /** The translation package path
    * @type {string} */
  // NOTE: We load the translation only here because the launcher will have
  //       to load it by itself (translations are not synchronous between
  //       main and child processes)
  let tr_path = fs.makeAbsolute('translations/' + translate.language + '.ntp');

  // If the translation was not loaded and a package exists for this language...
  if(!translate.loaded(tr_path) && fs.fileExists(tr_path) === true) {
    // Load the translation package
    error = translate.load(translate.language, tr_path);
    // If an error occured
    if(e(error))
      // Make it fatal
      debug.error(`Failed to load the translation package for "${translate.language}"`, error);
  }

  /** The dolphin's explorer file
    * @type {string|NightError} */
  let content = fs.readFile('explorer.js');

  // If the reading failed...
  if(e(content))
    // Make it fatal
    debug.error(tr('Failed to load the explorer script'), content);

  // Run the explorer file
  eval(content);
}
github ClementNerma / NightOS-v2 / apps / dolphin / dolphin.js View on Github external
// Load the translation package
    error = translate.load(translate.language, tr_path);
    // If an error occured
    if(e(error))
      // Make it fatal
      debug.error(`Failed to load the translation package for "${translate.language}"`, error);
  }

  /** The dolphin's explorer file
    * @type {string|NightError} */
  let content = fs.readFile('explorer.js');

  // If the reading failed...
  if(e(content))
    // Make it fatal
    debug.error(tr('Failed to load the explorer script'), content);

  // Run the explorer file
  eval(content);
}
github nativeloop / nativeloop / core.js View on Github external
params.jsonlint.parse = _.wrap( params.jsonlint.parse, function( func, input, opts ) {
		debug.error( 'you are here → jsonlint.parse: ' );
		debug.warn( 'input: ' + JSON.stringify( input, null, 2 ) );

		var result = func( input );
		return require( './fix-config' ).addWidgets( { input: result, logger: debug } );
		// return hjson.parse( input, opts );
	} );
github telekits / teleapi / index.js View on Github external
}).catch((error) => {
            let buffer = error;

            // hook
            if (buffer.name === 'HTTPError' && buffer.response.body) {
                buffer = new APIError(name, params, buffer.response.body);
                debug.error('%s(%s) %s', buffer.name, buffer.method, buffer.message);
            }

            throw buffer;
        });
    }
github NetEase / lordofpomelo / web-server / public / js / lib / colorbox / node.js View on Github external
util.each(componentAbilities, function(ability, i){
      if (self._componentsAbilities[ability])
      {
        //FIXME: ability conflict
        debug.error("ability conflict");
      }

      self._componentsAbilities[ability] = component;
    });
  },
github NetEase / lordofpomelo / web-server / public / js / lib / colorbox / node.js View on Github external
addComponent: function(type, component)
  {
    var componentAbilities
      , bExistedAbility = false
      , self = this
    
    if (this._component[type])
    {
      debug.error("add same type component again");
      return;
    }
    
    this._component[type] = component;
    componentAbilities = component.abilities();
    
    util.each(componentAbilities, function(ability, i){
      if (self._componentsAbilities[ability])
      {
        //FIXME: ability conflict
        debug.error("ability conflict");
      }

      self._componentsAbilities[ability] = component;
    });
  },