Skip to content

Commit

Permalink
fix(add-job): fix parent job cannot be replaced error message (#2441)
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf authored Feb 22, 2024
1 parent 7fc6f91 commit 1e9a13f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/bullmq/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def finishedErrors(self, code: int, jobId: str, command: str, state: str) -> Typ
elif code == ErrorCode.JobLockMismatch.value:
return TypeError(f"Lock mismatch for job {jobId}. Cmd {command} from {state}")
elif code == ErrorCode.ParentJobCannotBeReplaced.value:
return TypeError(f"The parent job of job {jobId} cannot be replaced. {command}")
return TypeError(f"The parent job {jobId} cannot be replaced. {command}")
else:
return TypeError(f"Unknown code {str(code)} error for {jobId}.{command}")

Expand Down
2 changes: 1 addition & 1 deletion src/classes/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export class Scripts {
);
case ErrorCode.ParentJobCannotBeReplaced:
return new Error(
`The parent job of job ${jobId} cannot be replaced. ${command}`,
`The parent job ${jobId} cannot be replaced. ${command}`,
);
default:
return new Error(`Unknown code ${code} error for ${jobId}. ${command}`);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ describe('flows', () => {
},
),
).to.be.rejectedWith(
`The parent job of job ${prefix}:${queueName}:wed cannot be replaced. addJob`,
`The parent job ${prefix}:${queueName}:wed cannot be replaced. addJob`,
);

await flow.close();
Expand Down

0 comments on commit 1e9a13f

Please sign in to comment.