FUNCTION: onDelete( [error] )
Callback invoked upon deleting a file.

@private
@param {Error} [error] - error object
@returns {Void}
424126
function onDelete( error ) {
			if ( error ) {
				debug( 'Error encountered while attempting to delete a temporary output file %s: %s', outFile, error.message );
				return done( error );
			}
			debug( 'Successfully deleted temporary output file: %s', outFile );
			done( null, file );
		}
707257
function () {
        var self = this;

        if (self.fileToDelete === null) {
            return;
        }

        fs.remove(self.fileToDelete, function (err) {
            if (err) {
                common.logging.error(new common.errors.GhostError({
                    err: err,
                    context: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.error'),
                    help: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.context')
                }));
            }

            self.fileToDelete = null;
        });
    }
114226
function handleError(e, done) {
    if(this.defaultValue) return done(null, this.defaultValue);
    if(this[defaultError]) return done(this[defaultError]);
    done(e);
  }
1082137
def delete_file(f, ignore_errors=False):
	
	try:
		os.remove(f)
	except Exception as ex:
		if ignore_errors:
			return
		print('ERROR deleting file ' + str(ex))
21158
function onFileReady(err, data) {
    if (err) {
      if (onDone) onDone(err);
      else console.error('>>>' + err);
      return;
    }

    var fileContent = data.toString();

    var options = {
      gfm: (flavour === 'gfm') ? true : false,
      breaks: true,
      tables: true,
      sanitize: true
    };

    if (highlight) {
      options['highlight'] = function(code, lang, callback) {
        pygmentize({lang: lang, format: 'html'}, code, function(err, result) {
          if (err) {
            callback(err);
          }
          callback(err, result.toString());
        });
      }
    }

    //======================================================
    // Call marked to parse the file content
    //======================================================
    if (this.debug) console.error('>>>starting to get code');
    try {
      marked.setOptions(options);
      marked(fileContent, getCode.bind(this));
    } catch(err) {
      if (onDone) onDone(err)
      else console.error('>>>' + err);
    }

    //======================================================
    // Enhance the output of marked with optional header
    // or trailer. Linkify if context specified.
    //======================================================
    function getCode(err, code) {
      if (err) {
        if (onDone) onDone(err)
        else console.error('>>>' + err);
        return;
      }

      if (htmlTemplate) {
        this.cat(fs.readFileSync(htmlTemplate));

        let mdCode = ''
        if (context) {
          mdCode = linkify(code, context);
        } else {
          mdCode = code;
        }
        this.replace(mdCode);
      } else {
        if (stylesheet || title) {
          if (titleText == null) titleText = fileName;
          this.cat('<!DOCTYPE html>\n' +
                   '<html>\n' +
                   '<head>\n' +
                   '  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>' + 
                   '  <title>' + titleText + '</title>\n');
          if (stylesheet) {
            this.cat('  <link rel="stylesheet" href="' + stylesheet + '">\n');
          }
          this.cat('</head>\n<body>\n' );
        }

        if (context) {
          this.cat( linkify(code, context) );
        } else {
          this.cat( code );
        }

        if (stylesheet || title) {
          this.cat( '</body>\n</html>\n' );
        }  
      }
      
      if (this.debug) console.error('>>>finished getting code');
      this.done = true;
      if (onDone) onDone();
    } // end getCode
  }
646843
function onDISCONNECT(self, reason, code, desc, lang) { // Client/Server
  if (code !== DISCONNECT_REASON.BY_APPLICATION) {
    var err = new Error(desc || reason);
    err.code = code;
    self.emit('error', err);
  }
  self.reset();
}
20773
function onDeleteSuccess(model, params, result) {
  Flux.dispatch(actionTypes.API_DELETE_SUCCESS, {
    model: model,
    params: params,
    result: result,
  })
  return result
}
811849
public function delete()
    {
        $this->brokenOnDelete = true;
        $this->onBeforeDelete();
        if ($this->brokenOnDelete) {
            user_error("$this->class has a broken onBeforeDelete() function."
            . " Make sure that you call parent::onBeforeDelete().", E_USER_ERROR);
        }

        $path = $this->getFullPath();
        if (file_exists($path)) {
            unlink($path);
        }
        if ($this->storeRecord) {
            $this->storeRecord->delete();
        }

        $this->flushCache();
        $this->onAfterDelete();
    }
901536
function onError(error) {
    me.terminated = true;
    if (me.terminating && me.terminationHandler) {
      me.terminationHandler(me);
    }
    me.terminating = false;

    for (var id in me.processing) {
      if (me.processing[id] !== undefined) {
        me.processing[id].resolver.reject(error);
      }
    }
    me.processing = Object.create(null);
  }
923560
function onError( error ) {
        logger.error( error.stack || error );
        process.exit( EXIT_FAILURE );
    }
795522
function error (err, file, name, options) {
  var message = err.message
  var column = err.column
  var line = err.line
  var type = err.name
  var method = 'message'

  if (options.throws) {
    method = 'fail'
  }

  file[method](
    message,
    { line: line, column: column },
    'parseFrontMatter:' + name + ':' + type
  )
}
1319998
function (src, success, error) {
		var s = document.createElement('script');
		s.src = src;
		s.async = true;
		s.onload = function() {
			document.body.removeChild(s);
			success && success();
		};
		s.onerror = function() {
			document.body.removeChild(s);
			error && error();
		};
		document.body.appendChild(s);
	}
177475
function deleteFile(req, res) {
		var rest = req.params["0"];
		var file = fileUtil.getFile(req, rest);
		fileUtil.withStatsAndETag(file.path, function(error, stats, etag) {
			var callback = function(error) {
				if (error) {
					return writeError(500, res, error);
				}
				sendStatus(204, res);
			};
			var ifMatchHeader = req.headers['if-match'];
			if (error && error.code === 'ENOENT') {
				return sendStatus(204, res);
			} else if (error) {
				writeError(500, res, error);
			} else if (ifMatchHeader && ifMatchHeader !== etag) {
				return sendStatus(412, res);
			} else if (stats.isDirectory()) {
				fileUtil.rumRuff(file.path, callback);
			} else {
				fs.unlink(file.path, callback);
			}
		});
	}
749649
function onFile( error, file ) {
		if ( error ) {
			debug( 'Error encountered while attempting to read a temporary output file %s: %s', outFile, error.message );
			return done( error );
		}
		debug( 'Successfully read temporary output file: %s', outFile );
		unlink( outFile, onDelete );

		/**
		* FUNCTION: onDelete( [error] )
		*	Callback invoked upon deleting a file.
		*
		* @private
		* @param {Error} [error] - error object
		* @returns {Void}
		*/
		function onDelete( error ) {
			if ( error ) {
				debug( 'Error encountered while attempting to delete a temporary output file %s: %s', outFile, error.message );
				return done( error );
			}
			debug( 'Successfully deleted temporary output file: %s', outFile );
			done( null, file );
		} // end FUNCTION onDelete()
	}
308986
function done(err, files) {
    // On processing errors notify the watcher (if listening) that square is idle.
    if (err && self.writable) {
      self.logger.error(err);
      return fn(err);
    }

    // Stop our cache, it will be activated again when we need it
    self.cache.stop();

    // Merge the results array to a key=>value object
    files = (files || []).reduce(function reduceFiles(memo, collection) {
      memo[collection.basename] = collection;
      return memo;
    }, {});

    // Building is done, call callback if available.
    self.logger.info('Successfully generated %s', Object.keys(files).join(', ').green);
    if (err && !args.function) self.critical(err);
    if (args.function) args.function.call(self, err, files, extensions);
  }
1001643
function(error) {
			if (error) {
				console.error(error.toString());
			}
			process.exit(cfg.ERROR_EXIT);
		}
761650
function(changed) {
			$.each(changed, function(i, file) {
				var hash = file.hash;
				if (files[hash]) {
					$.each(Object.keys(files[hash]), function(i, v){
						if (typeof file[v] === 'undefined') {
							delete files[hash][v];
						}
					});
				}
				files[hash] = files[hash] ? Object.assign(files[hash], file) : file;
			});
		}