Added error handling

This commit is contained in:
Jonas Bovin 2022-12-09 11:59:59 +01:00
parent 2a9db83c42
commit 085e38d2d3
2 changed files with 31 additions and 8 deletions

20
dist/index.js vendored
View file

@ -13636,10 +13636,22 @@ class se_Helper {
createMetaJson(root) { createMetaJson(root) {
const execSync = external_child_process_.execSync; const execSync = external_child_process_.execSync;
console.log('Run number: ' + this.currentBuild.runNumber); console.log('Run number: ' + this.currentBuild.runNumber);
const xmllint = execSync('sudo apt install libxml2-utils', { try {
shell: '/bin/bash' const xmllint = execSync('sudo apt install libxml2-utils', {
}); shell: '/bin/bash'
console.log(xmllint.toString()); });
console.log(xmllint.toString());
}
catch (err) {
let message;
if (err instanceof Error) {
message = err.message;
}
else {
message = String(err);
}
console.log(message);
}
const ret = []; const ret = [];
const poms = this.listPoms(root); const poms = this.listPoms(root);
const ownersFile = Object(external_fs_.readFileSync)(root + '.github/CODEOWNERS', 'utf8') const ownersFile = Object(external_fs_.readFileSync)(root + '.github/CODEOWNERS', 'utf8')

View file

@ -46,10 +46,21 @@ export class Helper {
public createMetaJson(root: string) { public createMetaJson(root: string) {
const execSync = child.execSync const execSync = child.execSync
console.log('Run number: ' + this.currentBuild.runNumber) console.log('Run number: ' + this.currentBuild.runNumber)
const xmllint = execSync('sudo apt install libxml2-utils', { try {
shell: '/bin/bash' const xmllint = execSync('sudo apt install libxml2-utils', {
}) shell: '/bin/bash'
console.log(xmllint.toString()) })
console.log(xmllint.toString())
} catch (err) {
let message
if (err instanceof Error) {
message = err.message
} else {
message = String(err)
}
console.log(message)
}
const ret: string[] = [] const ret: string[] = []
const poms = this.listPoms(root) const poms = this.listPoms(root)
const ownersFile = fs const ownersFile = fs