diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-02-23 14:46:42 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-02-23 14:46:42 -0800 |
commit | f4c653b749d43b3e5c71d59c67f31e753ff27e07 (patch) | |
tree | 2a52ebdb31c65f9b26ea975cf150023e7762d70c /cpp/src/slice2java/Main.cpp | |
parent | bug 3715 - improving warning/error handling in Eclipse plugin (diff) | |
download | ice-f4c653b749d43b3e5c71d59c67f31e753ff27e07.tar.bz2 ice-f4c653b749d43b3e5c71d59c67f31e753ff27e07.tar.xz ice-f4c653b749d43b3e5c71d59c67f31e753ff27e07.zip |
bug 3715 - translator changes to improve warning/error handling in Eclipse
Diffstat (limited to 'cpp/src/slice2java/Main.cpp')
-rw-r--r-- | cpp/src/slice2java/Main.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp index cb98ac9823c..24d4a7c9263 100644 --- a/cpp/src/slice2java/Main.cpp +++ b/cpp/src/slice2java/Main.cpp @@ -226,7 +226,7 @@ main(int argc, char* argv[]) { FileTracker::instance()->setSource(*i, os.str(), true); status = EXIT_FAILURE; - continue; + break; } if(preprocess) @@ -265,7 +265,6 @@ main(int argc, char* argv[]) { try { - FileTracker::instance()->setSource(*i, os.str(), false); Gen gen(argv[0], icecpp.getBaseName(), includePaths, output); gen.generate(p, stream); if(tie) @@ -288,15 +287,19 @@ main(int argc, char* argv[]) ChecksumMap m = createChecksums(p); copy(m.begin(), m.end(), inserter(checksums, checksums.begin())); } + FileTracker::instance()->setSource(*i, os.str(), false); } catch(const Slice::FileException& ex) { - // If a file could not be created, then - // cleanup any created files. + // + // If a file could not be created then cleanup any files we've already created. + // FileTracker::instance()->cleanup(); p->destroy(); - getErrorStream() << argv[0] << ": error: " << ex.reason() << endl; - return EXIT_FAILURE; + os << argv[0] << ": error: " << ex.reason() << endl; + FileTracker::instance()->setSource(*i, os.str(), true); + status = EXIT_FAILURE; + break; } } p->destroy(); @@ -308,8 +311,9 @@ main(int argc, char* argv[]) if(_interrupted) { - // If the translator was interrupted, then cleanup any - // created files. + // + // If the translator was interrupted then cleanup any files we've already created. + // FileTracker::instance()->cleanup(); return EXIT_FAILURE; } @@ -321,7 +325,7 @@ main(int argc, char* argv[]) cout << "</dependencies>\n"; } - if(!checksumClass.empty()) + if(status == EXIT_SUCCESS && !checksumClass.empty()) { try { |