From 7b94f9618cd584819fcdff787dec65452631def8 Mon Sep 17 00:00:00 2001 From: emsesc Date: Fri, 16 Apr 2021 15:42:23 -0400 Subject: [PATCH] Handle yaml error Create issue containing yaml error --- functions/data.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions/data.js b/functions/data.js index 9b89654..6294c72 100644 --- a/functions/data.js +++ b/functions/data.js @@ -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;