Skip to content

Commit 3771b85

Browse files
committed
fix: fail when translation json file not found.
1 parent 0ba3b76 commit 3771b85

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/gatsby-node.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ exports.onCreatePage = async ({ page, actions }, pluginOptions) => {
5151
try {
5252
// TODO load yaml here
5353
const messages = require(`${path}/${language}.json`)
54-
//
54+
5555
return flattenMessages(messages)
56-
} catch (err) {
57-
return {}
56+
} catch (error) {
57+
console.error(`[gatsby-plugin-intl] error`, error)
58+
59+
throw error
5860
}
5961
}
6062

0 commit comments

Comments
 (0)