GIScience / orstools-qgis-plugin

Plugin for QGIS with a set of tools to use openrouteservice API´s, based on openstreetmap
https://plugins.qgis.org/plugins/ORStools/
MIT License
92 stars 31 forks source link

Exception when not setting an API key #101

Closed m-kuhn closed 5 years ago

m-kuhn commented 5 years ago

The following error shows up when someone forgets to set the API key (which I assume is a common mistake for beginners ;) )

It would be nice to check if the API key is set and show a message (with a link where to get an API key) instead.

Traceback (most recent call last):
File "python/plugins/ORStools/proc/matrix_proc.py", line 240, in processAlgorithm
response = clnt.request(provider['endpoints'][self.ALGO_NAME], get_params, post_json=params)
File "python/plugins/ORStools/core/client.py", line 176, in request
blocking=True)
File "python/plugins/ORStools/core/networkaccessmanager.py", line 198, in request
req.setRawHeader(k.encode(), v.encode())
AttributeError: 'NoneType' object has no attribute 'encode'
nilsnolde commented 5 years ago

Yeah, that's true! Probably costing me quite a few stars on the repo;) I did that for the Pelias plugin, but apparently forgot to take it over to this one..

nilsnolde commented 5 years ago

uploaded in plugin repo