test/private/errorHasOccurred.m
raw| 1 | function errorOccurred = errorHasOccurred(status) |
| 2 | % determines whether an error has occurred from a status struct OR cell array |
| 3 | % of status structs |
| 4 | errorOccurred = false; |
| 5 | if iscell(status) |
| 6 | for iStatus = 1:numel(status) |
| 7 | errorOccurred = errorOccurred || errorHasOccurred(status{iStatus}); |
| 8 | end |
| 9 | else |
| 10 | stages = getStagesFromStatus(status); |
| 11 | for iStage = 1:numel(stages) |
| 12 | thisStage = status.(stages{iStage}); |
| 13 | errorOccurred = errorOccurred || thisStage.error; |
| 14 | end |
| 15 | end |
| 16 | end |