Skip to content

Commit bf03419

Browse files
committed
add user context on error
Signed-off-by: Alexandre Ferreira <alexjorgef@protonmail.com>
1 parent 4b5251a commit bf03419

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

plugin/src/on-plugin-init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Original error: ${context.sourceMessage}`,
1515
text: (context) =>
1616
`There was an error creating the "DiscogsUser" node.
1717
18-
Original error: ${context.sourceMessage}`,
18+
Original error (username: ${context.username}): ${context.sourceMessage}`,
1919
level: `ERROR`,
2020
category: `USER`,
2121
},

plugin/src/source-nodes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const sourceNodes: GatsbyNode["sourceNodes"] = async (gatsbyApi, pluginOp
2121
gatsbyApi.reporter.panicOnBuild({
2222
id: ERROR_CODES.createDiscogsUser,
2323
context: {
24-
sourceMessage: username,
24+
sourceMessage: error.message,
25+
username,
2526
},
2627
})
2728
}

0 commit comments

Comments
 (0)