Skip to content

Commit

Permalink
fix(core): separate multiple task errors by newline (spinnaker#7355)
Browse files Browse the repository at this point in the history
  • Loading branch information
maggieneterval committed Aug 28, 2019
1 parent fe5c954 commit d131e01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('orchestratedItem transformer', () => {
});

it('returns general exception if present', () => {
expect(getMessage({ context: { exception: { details: { errors: ['E1', 'E2'] } } } })).toBe('E1, E2');
expect(getMessage({ context: { exception: { details: { errors: ['E1', 'E2'] } } } })).toBe('E1\n\nE2');
expect(getMessage({ context: { exception: { details: { errors: [] } } } })).toBe(null);
expect(getMessage({ context: {} })).toBe(null);
});
Expand All @@ -61,7 +61,7 @@ describe('orchestratedItem transformer', () => {
},
},
};
expect(getMessage(stage)).toBe('E1, E2');
expect(getMessage(stage)).toBe('E1\n\nE2');
});

it('returns exception when it is in the last kato task', () => {
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('orchestratedItem transformer', () => {
},
],
};
expect(getMessage(task)).toBe('error 1, error 2');
expect(getMessage(task)).toBe('error 1\n\nerror 2');
});

it('returns null if an exception variable is present but has no details', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class OrchestratedItemTransformer {
if (generalException) {
const errors = get(generalException, 'details.errors', []).filter(m => !!m);
if (errors.length) {
return errors.join(', ');
return errors.join('\n\n');
}
if (generalException.details && generalException.details.error) {
return generalException.details.error;
Expand Down

0 comments on commit d131e01

Please sign in to comment.