Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Print tracebacks when geocoding or routing fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
otsaloma committed May 2, 2014
1 parent a8826da commit b777e27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion poor/geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import re
import sys
import time
import traceback

__all__ = ("Geocoder",)

Expand Down Expand Up @@ -70,7 +71,8 @@ def geocode(self, query, x=0, y=0, xmin=-180, xmax=180, ymin=-90, ymax=90,
query, xmin, xmax, ymin, ymax, nmax)
except Exception as error:
# XXX: Should we relay an error message to QML?
print("Geocoding failed: {}".format(str(error)), file=sys.stderr)
print("Geocoding failed:", file=sys.stderr)
traceback.print_exc()
return []
for result in results:
result["distance"] = self._format_distance(x,
Expand Down
4 changes: 3 additions & 1 deletion poor/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import re
import sys
import time
import traceback

__all__ = ("Router",)

Expand Down Expand Up @@ -88,7 +89,8 @@ def route(self, fm, to):
return self._provider.route(fm, to)
except Exception as error:
# XXX: Should we relay an error message to QML?
print("Routing failed: {}".format(str(error)), file=sys.stderr)
print("Routing failed:", file=sys.stderr)
traceback.print_exc()
return {}

@property
Expand Down

0 comments on commit b777e27

Please sign in to comment.