Skip to content

Commit

Permalink
Handle yaml error
Browse files Browse the repository at this point in the history
Create issue containing yaml error
  • Loading branch information
emsesc committed Apr 16, 2021
1 parent 5152a8a commit 7b94f96
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions functions/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ const yamlFile = async (context) => {
let fileContents = yamlfile
configyml = yaml.load(fileContents);
} catch (e) {
const issueBody = context.issue({
title: "[ERROR] Please read",
body: `There was an issue parsing the config file of this course. Please contact your counselor and send them the below error.\n${e}`,
});

context.octokit.issues.create(issueBody)
console.log("ERROR: " + e);
return null
}

return configyml;
Expand Down

0 comments on commit 7b94f96

Please sign in to comment.