diff saveeps.m @ 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 48b6fb693025
children a2b95af82f68
line wrap: on
line diff
--- 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.