Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bump to 0.7.16 with datasource extent exception handling

  • Loading branch information...
commit 2232c48ac53a5d4ade94d9c1a6adeeeb836845a7 1 parent 89163fb
@springmeyer springmeyer authored
Showing with 23 additions and 4 deletions.
  1. +4 −0 CHANGELOG.md
  2. +1 −1  package.json
  3. +18 −3 src/mapnik_datasource.cpp
View
4 CHANGELOG.md
@@ -1,5 +1,9 @@
# Changlog
+## 0.7.16
+
+ - Fixed handling of datasource exception when calculating extent
+
## 0.7.15
2012-10-09
View
2  package.json
@@ -4,7 +4,7 @@
"url" : "http://github.com/mapnik/node-mapnik",
"homepage" : "http://mapnik.org",
"author" : "Dane Springmeyer <dane@dbsgeo.com> (mapnik.org)",
- "version" : "0.7.15",
+ "version" : "0.7.16",
"main" : "./lib/mapnik.js",
"bugs" : {
"email" : "dane@dbsgeo.com",
View
21 src/mapnik_datasource.cpp
@@ -157,8 +157,23 @@ Handle<Value> Datasource::extent(const Arguments& args)
{
HandleScope scope;
Datasource* d = ObjectWrap::Unwrap<Datasource>(args.This());
+ mapnik::box2d<double> e;
+ try
+ {
+ e = d->datasource_->envelope();
+ }
+ catch (std::exception const& ex)
+ {
+ return ThrowException(Exception::Error(
+ String::New(ex.what())));
+ }
+ catch (...)
+ {
+ return ThrowException(Exception::Error(
+ String::New("unknown exception happened getting datasource extent, please file bug")));
+ }
+
Local<Array> a = Array::New(4);
- mapnik::box2d<double> const& e = d->datasource_->envelope();
a->Set(0, Number::New(e.minx()));
a->Set(1, Number::New(e.miny()));
a->Set(2, Number::New(e.maxx()));
@@ -175,7 +190,7 @@ Handle<Value> Datasource::describe(const Arguments& args)
{
node_mapnik::describe_datasource(description,d->datasource_);
}
- catch (std::exception const& ex )
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
@@ -214,7 +229,7 @@ Handle<Value> Datasource::features(const Arguments& args)
{
node_mapnik::datasource_features(a,d->datasource_,first,last);
}
- catch (std::exception const& ex )
+ catch (std::exception const& ex)
{
return ThrowException(Exception::Error(
String::New(ex.what())));
Please sign in to comment.
Something went wrong with that request. Please try again.