From d8d60c60ebeeefb068d9b68bf7d96f1f1f88518a Mon Sep 17 00:00:00 2001 From: Adib Taraben Date: Sat, 1 Aug 2009 23:31:02 +0000 Subject: FIX 309856 353847: correctly advertise exception leads to error message dialogue (bzr r8380) --- src/extension/implementation/script.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/extension/implementation/script.h') diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index 4620375f9..8e25fb351 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -135,7 +135,7 @@ private: /** * */ - void checkStderr (const Glib::ustring &filename, + void checkStderr (const Glib::ustring &filename, Gtk::MessageType type, const Glib::ustring &message); @@ -146,7 +146,7 @@ private: Glib::RefPtr _channel; Glib::RefPtr _main_loop; bool _dead; - + public: file_listener () : _dead(false) { }; virtual ~file_listener () { @@ -187,11 +187,15 @@ private: // Note, doing a copy here, on purpose Glib::ustring string (void) { return _string; }; - void toFile (const Glib::ustring &name) { + bool toFile (const Glib::ustring &name) { + try { Glib::RefPtr stdout_file = Glib::IOChannel::create_from_file(name, "w"); stdout_file->set_encoding(); stdout_file->write(_string); - return; + } catch (Glib::FileError &e) { + return false; + } + return true; }; }; -- cgit v1.2.3