Skip to content

Commit 7b94f96

Browse files
committed
Handle yaml error
Create issue containing yaml error
1 parent 5152a8a commit 7b94f96

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

functions/data.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,14 @@ const yamlFile = async (context) => {
9090
let fileContents = yamlfile
9191
configyml = yaml.load(fileContents);
9292
} catch (e) {
93+
const issueBody = context.issue({
94+
title: "[ERROR] Please read",
95+
body: `There was an issue parsing the config file of this course. Please contact your counselor and send them the below error.\n${e}`,
96+
});
97+
98+
context.octokit.issues.create(issueBody)
9399
console.log("ERROR: " + e);
100+
return null
94101
}
95102

96103
return configyml;

0 commit comments

Comments
 (0)