|
From: <br...@us...> - 2011-02-05 07:23:22
|
Revision: 4224
http://openvrml.svn.sourceforge.net/openvrml/?rev=4224&view=rev
Author: braden
Date: 2011-02-05 07:23:15 +0000 (Sat, 05 Feb 2011)
Log Message:
-----------
Catch any exceptions thrown from openvrml::browser::set_world.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/local/libopenvrml-control/openvrml_control/browser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-02-03 06:41:02 UTC (rev 4223)
+++ trunk/ChangeLog 2011-02-05 07:23:15 UTC (rev 4224)
@@ -1,3 +1,10 @@
+2011-02-05 Braden McDaniel <br...@en...>
+
+ * src/local/libopenvrml-control/openvrml_control/browser.cpp
+ (openvrml_control::browser::initial_stream_reader::operator()
+ const): Catch any exceptions thrown from
+ openvrml::browser::set_world.
+
2011-02-03 Braden McDaniel <br...@en...>
* src/script/javascript.vcxproj: Define
Modified: trunk/src/local/libopenvrml-control/openvrml_control/browser.cpp
===================================================================
--- trunk/src/local/libopenvrml-control/openvrml_control/browser.cpp 2011-02-03 06:41:02 UTC (rev 4223)
+++ trunk/src/local/libopenvrml-control/openvrml_control/browser.cpp 2011-02-05 07:23:15 UTC (rev 4224)
@@ -597,12 +597,12 @@
}
struct OPENVRML_LOCAL openvrml_control::browser::initial_stream_reader {
- initial_stream_reader(
- const boost::shared_ptr<plugin_streambuf> & streambuf,
- openvrml::browser & browser):
+ initial_stream_reader(const boost::shared_ptr<plugin_streambuf> & streambuf,
+ openvrml::browser & browser)
+ throw ():
streambuf_(streambuf),
browser_(browser)
- {}
+ {}
void operator()() const throw ()
{
@@ -611,7 +611,8 @@
public:
explicit plugin_istream(
- const boost::shared_ptr<plugin_streambuf> & streambuf):
+ const boost::shared_ptr<plugin_streambuf> & streambuf)
+ throw ():
openvrml::resource_istream(streambuf.get()),
streambuf_(streambuf)
{}
@@ -625,8 +626,7 @@
return this->streambuf_->url();
}
- virtual const std::string do_type() const
- throw (std::bad_alloc)
+ virtual const std::string do_type() const throw (std::bad_alloc)
{
return this->streambuf_->type();
}
@@ -637,7 +637,16 @@
}
} in(this->streambuf_);
- this->browser_.set_world(in);
+ try {
+ this->browser_.set_world(in);
+ } catch (const openvrml::invalid_vrml & ex) {
+ std::ostringstream out;
+ out << ex.url << ':' << ex.line << ':' << ex.column << ": error: "
+ << ex.what();
+ this->browser_.err(out.str());
+ } catch (const std::exception & ex) {
+ this->browser_.err(ex.what());
+ }
}
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|