diff --git a/src/jira-connector.ts b/src/jira-connector.ts index 1710b22..e1cb144 100644 --- a/src/jira-connector.ts +++ b/src/jira-connector.ts @@ -46,8 +46,9 @@ export class JiraConnector { }, }; } catch (error) { + console.log('Error fetching details from JIRA.') if (error.response) { - throw new Error(JSON.stringify(error.response, null, 4)); + throw new Error(JSON.stringify(error.response.data, null, 4)); } throw error; } diff --git a/src/main.ts b/src/main.ts index 8e7f4fc..8a4f8c5 100755 --- a/src/main.ts +++ b/src/main.ts @@ -26,7 +26,7 @@ async function run(): Promise { const details = await jiraConnector.getTicketDetails(issueKey); await githubConnector.updatePrDetails(details); } catch (error) { - console.log('JIRA key was not found'); + console.log('Failed to add JIRA description to PR.'); core.error(error.message); if (FAIL_WHEN_JIRA_ISSUE_NOT_FOUND) {