Skip to content

Commit

Permalink
Fixes for bugs #1574 #1575 (#1576)
Browse files Browse the repository at this point in the history
* fix: correctly retrieve payloadFile argument
* fix: don't try to read prop from nullish element
* fix: log uncaught exceptions
  e.g. expired personal access token

---------

Co-authored-by: Stan Stanislaus <stan.stanislaus@steffesgroup.com>
Co-authored-by: Richard Fennell <bm-richard.fennell@outlook.com>
  • Loading branch information
3 people authored Dec 6, 2023
1 parent 0222407 commit 3f8806c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function run(): Promise<number> {
var gitHubPat = argv["githubpat"];
var bitbucketUser = argv["bitbucketuser"];
var bitbucketSecret = argv["bitbucketsecret"];
var payloadFile = argv["payloadfile"];
var payloadFile = argv["payloadFile"];

var showUsage = false;
if (!filename || filename.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ import { stringify } from "querystring";
import { Exception } from "handlebars";
import { IdentityDisplayFormat } from "azure-devops-node-api/interfaces/WorkInterfaces";

process.on("uncaughtException", (error) => {
console.error("Uncaught Exception:", error);
});

let agentApi = new AgentSpecificApi();

export function getDeploymentCount(environments: ReleaseEnvironment[], environmentName: string): number {
Expand Down Expand Up @@ -968,7 +972,7 @@ export function processTemplate(
handlebars.registerHelper("lookup_a_work_item", function (array, url) {
var urlParts = url.split("/");
var wiId = parseInt(urlParts[urlParts.length - 1]);
return array.find(element => element.id === wiId);
return array.find(element => element?.id === wiId);
});

// add our helper to find test configuration
Expand Down

0 comments on commit 3f8806c

Please sign in to comment.