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

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function out = print_error(err)
Daniel@0 2 % ---
Daniel@0 3 % print error messages
Daniel@0 4 % and following lines: stack
Daniel@0 5 % ---
Daniel@0 6 out.msg = sprintf('%s\n',err.message);
Daniel@0 7 if nargout < 1
Daniel@0 8 fprintf(out.msg);
Daniel@0 9 end
Daniel@0 10
Daniel@0 11 for e = 1:length(err.stack)
Daniel@0 12 out.line{e} = sprintf('%s at %i\n',err.stack(e).name, err.stack(e).line);
Daniel@0 13 if nargout < 1
Daniel@0 14 fprintf(out.line{e});
Daniel@0 15 end
Daniel@0 16 end
Daniel@0 17