Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/githubSyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function fetchPublicRepositories(owner) {
},
);

if (result.status !== 0) {
if (result.status !== 0 || result.error) {
const stderr = typeof result.stderr === "string" ? result.stderr.trim() : "";
const stdout = typeof result.stdout === "string" ? result.stdout.trim() : "";
const processError =
Expand Down
2 changes: 1 addition & 1 deletion src/services/releaseDayService.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function runCommand(command, args) {
encoding: "utf8",
});

if (result.status !== 0) {
if (result.status !== 0 || result.error) {
const stderr = typeof result.stderr === "string" ? result.stderr.trim() : "";
const stdout = typeof result.stdout === "string" ? result.stdout.trim() : "";
const processError =
Expand Down
11 changes: 8 additions & 3 deletions src/services/trackerSyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ function runPowerShellScript(script) {
encoding: "utf8",
});

if (result.status !== 0) {
if (result.status !== 0 || result.error) {
const stderr = typeof result.stderr === "string" ? result.stderr.trim() : "";
const stdout = typeof result.stdout === "string" ? result.stdout.trim() : "";
const processError =
result.error && result.error.message ? result.error.message : "";

throw new Error(
result.stderr.trim() || result.stdout.trim() || "PowerShell script failed.",
processError || stderr || stdout || "PowerShell script failed.",
);
}

return result.stdout.trim();
return typeof result.stdout === "string" ? result.stdout.trim() : "";
}

/**
Expand Down
Loading