Skip to content

Commit 0a783ff

Browse files
committed
fix(node): catch graphql errors thrown by page helpers
1 parent 5ce8f49 commit 0a783ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/gatsby/lib/pages-creator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ export default class PagesCreator {
109109
createAdvancedPage: args => this.createPage(args)
110110
})
111111
} catch (e) {
112+
if (typeof e[0] !== 'undefined') {
113+
e = e[0]
114+
}
115+
112116
const error = new Error(
113117
`Error occured while running page helper function at '${page.helperPath}':` +
114118
`\n${e.message}`

0 commit comments

Comments
 (0)