Commit d52ca128 authored by Brad Kennedy's avatar Brad Kennedy
Browse files

Prevent errors in ef_print_error from preventing a non zero exit code

parent 40e49996
......@@ -27,14 +27,18 @@
% Suite 330, Boston, MA 02111-1307 USA
function ef_print_error(err)
builtin('disp', ['Error: ' err.message]);
output = '';
stack = err.stack;
for i = 1:numel(stack)
level = stack(i);
output = [output sprintf('\tat %s(%s:%d)\n', level.file, level.name, ...
level.line)];
try
builtin('disp', ['Error: ' err.message]);
output = '';
stack = err.stack;
for i = 1:numel(stack)
level = stack(i);
output = [output sprintf('\tat %s(%s:%d)\n', level.file, ...
level.name, level.line)];
end
builtin('disp', ['Stack trace:', char(10), output]);
catch err
builtin('disp', ['Stack trace not available, error was' err.message]);
end
builtin('disp', ['Stack trace:', char(10), output]);
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment