Skip to content

Commit

Permalink
Merge pull request cakeinpanic#43 from ryanburr/ryanburr/fix/logging-…
Browse files Browse the repository at this point in the history
…errors

fix: stringify response data instead of whole response
  • Loading branch information
cakeinpanic authored Aug 31, 2023
2 parents 1c7a4d8 + 4478a80 commit 692e1a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/jira-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function run(): Promise<void> {
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) {
Expand Down

0 comments on commit 692e1a8

Please sign in to comment.