Skip to content

Commit

Permalink
Merge pull request #411 from imdone/1.47.2
Browse files Browse the repository at this point in the history
Throw a combination error for fileOk during extraction
  • Loading branch information
piascikj authored Nov 4, 2024
2 parents 0aaffeb + a2628dd commit 917260b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ Repository.prototype.addFile = function (file, cb) {
if (this.destroyed) return cb(new Error('destroyed'))
var self = this
this.fileOK(file, function (err, ok) {
if (err) return cb(err)
if (ok) {
var index = self.files.findIndex(({ path }) => path === file.path)
if (index > -1) {
Expand Down Expand Up @@ -945,10 +946,10 @@ Repository.prototype.writeAndExtract = function (file, emit, cb) {
if (err)
return cb(new Error('Unable to extract tasks for file:' + file.path))
this.addFile(file, (err) => {
if (err)
return cb(
new Error('Unable to add file after extracting tasks:' + file.path)
)
if (err) {
err.message = `Unable to add file after extracting tasks: #{file.path}\n${err.message}`
return cb(err)
}
cb(null, file)
})
})
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imdone-core",
"version": "1.47.1",
"version": "1.47.2",
"description": "imdone-core",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 917260b

Please sign in to comment.