File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ extern void SchemaInit( class Registry & );
1818#include < STEPattribute.h>
1919#include < ExpDict.h>
2020#include < Registry.h>
21+ #include < errordesc.h>
2122#include < algorithm>
2223#include < string>
2324#include < unistd.h>
@@ -138,6 +139,8 @@ int main( int argc, char * argv[] ) {
138139
139140 checkSchemaName ( registry, sfile, ignoreErr );
140141
142+ Severity readSev = sfile.Error ().severity (); // otherwise, errors from reading will be wiped out by sfile.WriteExchangeFile()
143+
141144 cout << " EXAMPLE : write file ..." << endl;
142145 if ( argc == optind+2 ) {
143146 flnm = argv[optind+1 ];
@@ -148,7 +151,7 @@ int main( int argc, char * argv[] ) {
148151 sfile.Error ().PrintContents (cout);
149152 cout << flnm << " written" << endl;
150153
151- if ( sfile.Error ().severity () <= SEVERITY_INCOMPLETE ) { // lower is worse
154+ if ( ( sfile.Error ().severity () <= SEVERITY_INCOMPLETE ) || ( readSev <= SEVERITY_INCOMPLETE ) ) { // lower is worse
152155 exit (1 );
153156 }
154157}
You can’t perform that action at this time.
0 commit comments