Skip to content

Commit 231cf9f

Browse files
authored
fix: avoid joi validation error when using reporter.panic (#28291)
- previously just passing the error object would produce a joi error ``` Failed to validate error Error [ValidationError]: "name" is not allowed at Object.exports.process (/myproject/node_modules/@hapi/joi/lib/errors.js:202:19) at internals.Object._validateWithOptions (/myproject/node_modules/@hapi/joi/lib/types/any/index.js:763:31) at internals.Object.validate (/myproject/node_modules/@hapi/joi/lib/types/any/index.js:797:21) at constructError (/myproject/node_modules/gatsby-cli/lib/structured-errors/construct-error.js:52:32) at Reporter.error (/myproject/node_modules/gatsby-cli/lib/reporter/reporter.js:135:59) at Reporter.panic (/myproject/node_modules/gatsby-cli/lib/reporter/reporter.js:75:34) at Object.panic (/myproject/node_modules/gatsby/src/utils/api-runner-node.js:201:16) at /myproject/node_modules/gatsby-plugin-sharp/index.js:162:14 { isJoi: true, ```
1 parent 2b8fe12 commit 231cf9f

File tree

1 file changed

+1
-1
lines changed
  • packages/gatsby-plugin-sharp/src

1 file changed

+1
-1
lines changed

packages/gatsby-plugin-sharp/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function createJob(job, { reporter }) {
145145
}
146146

147147
promise.catch(err => {
148-
reporter.panic(err)
148+
reporter.panic(`error converting image`, err)
149149
})
150150

151151
return promise

0 commit comments

Comments
 (0)