diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/tools/print_error.m	Tue Feb 10 15:05:51 2015 +0000
@@ -0,0 +1,17 @@
+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
+