view 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
line wrap: on
line source
function out = print_error(err)
% ---
% print error messages
% and following lines: stack
% ---
out.msg = sprintf('%s\n',err.message);
if nargout < 1 
    fprintf(out.msg);
end

for e = 1:length(err.stack)
  out.line{e} = sprintf('%s at %i\n',err.stack(e).name, err.stack(e).line);
  if nargout < 1 
      fprintf(out.line{e});
  end
end