Skip to content

Commit a3c0e23

Browse files
luclerayKent C. Dodds
authored andcommitted
fix: Do not log error message when config is missing (#136)
* Do not log error message when no config is added * update snapshots * update snapshots (bis)
1 parent 800a12d commit a3c0e23

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,17 +294,16 @@ function getConfig(macro, filename, source, options) {
294294

295295
if (
296296
optionsConfig.options === undefined &&
297-
fileConfig.options === undefined
297+
fileConfig.options === undefined &&
298+
fileConfig.error !== undefined
298299
) {
299300
// eslint-disable-next-line no-console
300301
console.error(
301302
`There was an error trying to load the config "${configName}" ` +
302303
`for the macro imported from "${source}. ` +
303304
`Please see the error thrown for more information.`,
304305
)
305-
if (fileConfig.error !== undefined) {
306-
throw fileConfig.error
307-
}
306+
throw fileConfig.error
308307
}
309308

310309
if (

0 commit comments

Comments
 (0)