changeset 34:2b4f1d3e5630

Imporved error handling in saveeps. Fixed bug with vector fields in struct2string.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 06 Oct 2015 09:47:30 +0200
parents 6db2094976a6
children 61367018c46f
files saveeps.m struct2string.m
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
diff -r 6db2094976a6 -r 2b4f1d3e5630 saveeps.m
--- a/saveeps.m	Tue Oct 06 09:46:18 2015 +0200
+++ b/saveeps.m	Tue Oct 06 09:47:30 2015 +0200
@@ -30,12 +30,15 @@
     pagel = findPrefix(lines,'%%Pages:');
     boundl = findPrefix(lines,'%%BoundingBox:');
 
+
     if ~(length(pagel) == 2 && length(boundl) == 2)
-        error('Undexpected number of found lines');
+        warning('Undexpected number of found lines: %d , %d\nNot correcting the file',pagel, boundl);
+        return
     end
 
     if ~(strcmp(lines{pagel(1)},'%%Pages: (atend)') && strcmp(lines{boundl(1)},'%%BoundingBox: (atend)'))
-        error('Does the file really contain the error?');
+        warning('Does the file really contain the error?\nNot correcting the file');
+        return
     end
 
     % Overwrite the nasty lines with the nice ones.
diff -r 6db2094976a6 -r 2b4f1d3e5630 struct2string.m
--- a/struct2string.m	Tue Oct 06 09:46:18 2015 +0200
+++ b/struct2string.m	Tue Oct 06 09:47:30 2015 +0200
@@ -20,6 +20,6 @@
     if ischar(value)
         str = ['''' value ''''];
     else
-        str = num2str(value);
+        str = mat2str(value);
     end
 end
\ No newline at end of file