annotate core/tools/print_error.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function out = print_error(err)
wolffd@0 2 % ---
wolffd@0 3 % print error messages
wolffd@0 4 % and following lines: stack
wolffd@0 5 % ---
wolffd@0 6 out.msg = sprintf('%s\n',err.message);
wolffd@0 7 if nargout < 1
wolffd@0 8 fprintf(out.msg);
wolffd@0 9 end
wolffd@0 10
wolffd@0 11 for e = 1:length(err.stack)
wolffd@0 12 out.line{e} = sprintf('%s at %i\n',err.stack(e).name, err.stack(e).line);
wolffd@0 13 if nargout < 1
wolffd@0 14 fprintf(out.line{e});
wolffd@0 15 end
wolffd@0 16 end
wolffd@0 17