Skip to content

Commit

Permalink
feat: throw an error if limit is less than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Dec 10, 2020
1 parent b434304 commit 273615e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/factories/createPlanton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ const createPlanton = (configuration: PlantonConfiguration): Planton => {

const limit = concurrency - activeTaskInstructions.length;

if (limit < 1) {
throw new UnexpectedStateError('Limit cannot be less than 1.');
if (limit < 0) {
throw new UnexpectedStateError('Limit cannot be less than 0.');
}

try {
Expand Down

0 comments on commit 273615e

Please sign in to comment.