From 384205f799d943d75402e2917c62bec5e00eb4f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Wood Date: Tue, 25 Jul 2023 16:12:21 -0400 Subject: [PATCH] case for get tsrc pr status 404 --- src/lib/actions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/actions.js b/src/lib/actions.js index 007580a..0866f58 100644 --- a/src/lib/actions.js +++ b/src/lib/actions.js @@ -132,7 +132,6 @@ async function convertIssueID(owner, repo, issueID, write, contributor_id) { ); head = githubRes.head; res.mergeable = githubRes.mergeable; - // Error handling if (head === null || head === undefined) { throw new Error(); @@ -149,6 +148,10 @@ async function convertIssueID(owner, repo, issueID, write, contributor_id) { res.defaultHash = ghService.tsrcID; res.childDefaultHash = head; return res; + } else if (ghService.status === 404) { + res.defaultHash = head; + res.childDefaultHash = head; + return res; } if (write) { @@ -161,7 +164,7 @@ async function convertIssueID(owner, repo, issueID, write, contributor_id) { if (resCreateIssue.status === 201) { res.defaultHash = head; res.childDefaultHash = head; - return res; + return res; } else { throw new Error(); }