comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function out = print_error(err)
2 % ---
3 % print error messages
4 % and following lines: stack
5 % ---
6 out.msg = sprintf('%s\n',err.message);
7 if nargout < 1
8 fprintf(out.msg);
9 end
10
11 for e = 1:length(err.stack)
12 out.line{e} = sprintf('%s at %i\n',err.stack(e).name, err.stack(e).line);
13 if nargout < 1
14 fprintf(out.line{e});
15 end
16 end
17