Skip to content

Commit

Permalink
Add more validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Feb 6, 2022
1 parent a971735 commit e64fd19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/runners/cli/handler/start/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { inspect } from 'util'

import isPlainObj from 'is-plain-obj'

import { UserError } from '../../../../error/main.js'
import { TasksSyntaxError } from '../../../common/error.js'
import { validateTasks } from '../../../common/validate/file.js'
import { validateString } from '../../../common/validate/type.js'

Expand All @@ -26,7 +26,9 @@ const normalizeTask = function (task) {
}

if (!isPlainObj(task)) {
throw new UserError(`should be a string or an object not: ${inspect(task)}`)
throw new TasksSyntaxError(
`should be a string or an object not: ${inspect(task)}`,
)
}

return task
Expand Down

0 comments on commit e64fd19

Please sign in to comment.