|
9 | 9 | var util = require('util'); |
10 | 10 |
|
11 | 11 | const 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" |
| 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 | 28 | }; |
29 | 29 |
|
30 | 30 | function 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; |
| 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 | 36 | } |
37 | 37 |
|
38 | 38 | util.inherits(ArchiverError, Error); |
|
0 commit comments