Add error handling
All checks were successful
Generate Release / validate_and_release (push) Successful in 14s

This commit is contained in:
Fred Boniface 2024-03-08 13:16:25 +00:00
parent 4fbbf30fbd
commit fbefe15de8

View File

@ -40,7 +40,12 @@ function sortAndMergeYAMLFiles() {
outputString += ` stops: [${item.stops.map(stop => `${stop}`).join(',')}]\n`; outputString += ` stops: [${item.stops.map(stop => `${stop}`).join(',')}]\n`;
}); });
try {
fs.writeFileSync('./pis/gw.yaml', outputString); fs.writeFileSync('./pis/gw.yaml', outputString);
console.log("Overwritten gw.pis")
} catch (err) {
console.error("Error writing gw.pis", err)
}
files.forEach(file => { files.forEach(file => {
if (file.startsWith('dg_parser')) { if (file.startsWith('dg_parser')) {
@ -49,7 +54,6 @@ function sortAndMergeYAMLFiles() {
} }
}); });
console.log(outputString)
} catch(err) { } catch(err) {
console.error('Error merging YAML:', err) console.error('Error merging YAML:', err)
} }