Add try catch block
This commit is contained in:
Vendored
+11
-6
@@ -3172,12 +3172,17 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
|
||||
}
|
||||
var disable_sudo = process.env.STATE_disableSudo;
|
||||
if (disable_sudo !== "true") {
|
||||
var journalLog = external_child_process_namespaceObject.execSync("sudo journalctl -u agent.service --lines=1000", {
|
||||
encoding: "utf8",
|
||||
maxBuffer: 1024 * 1024 * 10 // 10MB buffer
|
||||
});
|
||||
console.log("Service log:");
|
||||
console.log(journalLog);
|
||||
try {
|
||||
var journalLog = external_child_process_namespaceObject.execSync("sudo journalctl -u agent.service --lines=1000", {
|
||||
encoding: "utf8",
|
||||
maxBuffer: 1024 * 1024 * 10 // 10MB buffer
|
||||
});
|
||||
console.log("Service log:");
|
||||
console.log(journalLog);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("Warning: Could not fetch service logs:", error.message);
|
||||
}
|
||||
}
|
||||
try {
|
||||
yield addSummary();
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+10
-6
@@ -82,12 +82,16 @@ import { isGithubHosted } from "./tls-inspect";
|
||||
|
||||
var disable_sudo = process.env.STATE_disableSudo;
|
||||
if (disable_sudo !== "true") {
|
||||
var journalLog = cp.execSync("sudo journalctl -u agent.service --lines=1000", {
|
||||
encoding: "utf8",
|
||||
maxBuffer: 1024 * 1024 * 10 // 10MB buffer
|
||||
});
|
||||
console.log("Service log:");
|
||||
console.log(journalLog);
|
||||
try {
|
||||
var journalLog = cp.execSync("sudo journalctl -u agent.service --lines=1000", {
|
||||
encoding: "utf8",
|
||||
maxBuffer: 1024 * 1024 * 10 // 10MB buffer
|
||||
});
|
||||
console.log("Service log:");
|
||||
console.log(journalLog);
|
||||
} catch (error) {
|
||||
console.log("Warning: Could not fetch service logs:", error.message);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user