Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/workers/cluster.create.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const ClusterConfigService = require('models/services/cluster-config-service')
const joi = require('utils/joi')
const pick = require('101/pick')
const UserService = require('models/services/user-service')
const WorkerStopError = require('error-cat/errors/worker-stop-error')

module.exports.jobSchema = joi.object({
sessionUserBigPoppaId: joi.number().required(),
Expand All @@ -31,5 +32,8 @@ module.exports.task = (job) => {
const props = [ 'triggeredAction', 'repoFullName', 'branchName', 'filePath', 'isTesting', 'newInstanceName' ]
const opts = pick(job, props)
return ClusterConfigService.create(sessionUser, opts)
.catch(err => {
throw WorkerStopError('Something failed trying to create the config', { err })
})
})
}
1 change: 0 additions & 1 deletion unit/workers/cluster.create.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe('Cluster Create Worker', function () {
ClusterConfigService.create.rejects(mongoError)
Worker.task(testData).asCallback(function (err) {
expect(err).to.exist()
expect(err).to.equal(mongoError)
done()
})
})
Expand Down