Skip to content

Commit 208cfa7

Browse files
authored
fix: never silence errors (#313)
I just lost 3 hours of my life not understanding why the `dataSources` field of the third argument of my resolvers were `undefined`. Just a missing parenthesis, hard to see without an error log of the error. Please never silence errors again, thank you :)
1 parent a526961 commit 208cfa7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graphql-server/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ module.exports = (options, cb = null) => {
3838
let dataSources
3939
try {
4040
dataSources = load(options.paths.dataSources)
41-
} catch (e) {}
41+
} catch (e) {
42+
console.error(e)
43+
}
4244

4345
// GraphQL API Server
4446

@@ -50,6 +52,7 @@ module.exports = (options, cb = null) => {
5052
const serverModule = load(options.paths.server)
5153
serverModule(app)
5254
} catch (e) {
55+
console.error(e)
5356
// No file found
5457
}
5558

0 commit comments

Comments
 (0)