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 | |
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')
-rw-r--r-- | cpp/src/Slice/JavaUtil.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Slice/PythonUtil.cpp | 2 | ||||
-rw-r--r-- | cpp/src/slice2java/Main.cpp | 22 |
3 files changed, 15 insertions, 11 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp index 87ed654e578..f0b063fbf59 100644 --- a/cpp/src/Slice/JavaUtil.cpp +++ b/cpp/src/Slice/JavaUtil.cpp @@ -3726,7 +3726,7 @@ Slice::JavaGenerator::MetaDataVisitor::visitSequence(const SequencePtr& p) if(!builtin || builtin->kind() != Builtin::KindByte) { _history.insert(s); - emitWarning(file, line, "ignoring invalid metadata `" + s + "':\n" + + emitWarning(file, line, "ignoring invalid metadata `" + s + "': " + "this metadata can only be used with a byte sequence"); } } diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index c718cbf5a92..79dcf784d5d 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -2109,7 +2109,7 @@ Slice::Python::MetaDataVisitor::visitSequence(const SequencePtr& p) BuiltinPtr builtin = BuiltinPtr::dynamicCast(p->type()); if(!builtin || builtin->kind() != Builtin::KindByte) { - emitWarning(file, line, "ignoring invalid metadata `" + s + ":\n" + + emitWarning(file, line, "ignoring invalid metadata `" + s + ": " + "`protobuf' encoding must be a byte sequence"); } } 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 { |