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
2 changes: 1 addition & 1 deletion workers/lib/server/handlers/spare.parts.handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async function updateSparePart (ctx, req) {
const partPushErrors = _pushErrors(partResults)
if (partPushErrors.length) {
const err = new Error(`ERR_PART_UPDATE_PUSH_FAILED:${partPushErrors.join(',')}`)
err.statusCode = 502
err.statusCode = 409
err.detail = { stage: 'part', partAction: null, workOrderAction: null }
throw err
}
Expand Down
4 changes: 2 additions & 2 deletions workers/lib/server/lib/work.orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function assertActionApplied (results, errCode) {
const errors = (results || []).flatMap(r => r?.errors || [])
if (errors.length) {
const err = new Error(`${errCode}:${errors.join(',')}`)
err.statusCode = 502
err.statusCode = 409
throw err
}
}
Expand All @@ -69,7 +69,7 @@ async function assertActionsExecuted (ctx, req, errCode) {
.flatMap(target => (target.calls || []).map(call => call.error).filter(Boolean)))
if (!errors.length) return
const err = new Error(`${errCode}:${errors.join(',')}`)
err.statusCode = 502
err.statusCode = 409
throw err
}

Expand Down
Loading