Skip to content

Commit

Permalink
fix(core): filter falsy error messages from errors object on tasks (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Jun 21, 2019
1 parent 4782808 commit bbc1d06
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { distanceInWords } from 'date-fns';
import { $log } from 'ngimport';
import { get } from 'lodash';

import { IOrchestratedItem, IOrchestratedItemVariable, ITask, ITaskStep } from 'core/domain';
import { ReactInjector } from 'core/reactShims';
Expand Down Expand Up @@ -161,8 +162,9 @@ export class OrchestratedItemTransformer {
private static getGeneralException(task: ITask): string {
const generalException: any = task.getValueFor('exception');
if (generalException) {
if (generalException.details && generalException.details.errors && generalException.details.errors.length) {
return generalException.details.errors.join(', ');
const errors = get(generalException, 'details.errors', []).filter(m => !!m);
if (errors.length) {
return errors.join(', ');
}
if (generalException.details && generalException.details.error) {
return generalException.details.error;
Expand Down

0 comments on commit bbc1d06

Please sign in to comment.