basant307/AI_Governance_Project
048
1/**2 * Archiver Core3 *4 * @ignore5 * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}6 * @copyright (c) 2012-2014 Chris Talkington, contributors.7 */8 9var util = require('util');10 11const ERROR_CODES = {12 'ABORTED': 'archive was aborted',13 'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value',14 'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function',15 'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value',16 'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value',17 'FINALIZING': 'archive already finalizing',18 'QUEUECLOSED': 'queue closed',19 'NOENDMETHOD': 'no suitable finalize/end method defined by module',20 'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module',21 'FORMATSET': 'archive format already set',22 'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance',23 'MODULESET': 'module already set',24 'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module',25 'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value',26 'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value',27 'ENTRYNOTSUPPORTED': 'entry not supported'28};29 30function ArchiverError(code, data) {31 Error.captureStackTrace(this, this.constructor);32 //this.name = this.constructor.name;33 this.message = ERROR_CODES[code] || code;34 this.code = code;35 this.data = data;36}37 38util.inherits(ArchiverError, Error);39 40exports = module.exports = ArchiverError;