planetfederal / qgis-suite-plugin

GNU General Public License v2.0
25 stars 17 forks source link

Better error message when unable to connect to GeoServer #44

Closed bmmpxf closed 10 years ago

bmmpxf commented 10 years ago

I tried to connect to my local GeoServer, but had forgotten that I had changed the port. The following is the error message I get when the plugin can't connect:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\gui\gsexploreritems.py", line 188, in 
    createCatalogAction.triggered.connect(lambda: self.addGeoServerCatalog(explorer))
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\gui\gsexploreritems.py", line 196, in addGeoServerCatalog
    v = cat.gsversion()
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\geoserver\catalog.py", line 86, in gsversion
    response, content = self.http.request(about_url, "GET")
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\httplib2\__init__.py", line 1591, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\httplib2\__init__.py", line 1339, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\httplib2\__init__.py", line 1275, in _conn_request
    conn.connect()
  File "C:\Users\Mike/.qgis2/python/plugins\opengeo\httplib2\__init__.py", line 910, in connect
    raise socket.error, msg
error: [Errno 10061] No connection could be made because the target machine actively refused it`

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.0.1-Dufour Dufour, d94c044`

Python path: ['C:\\Users\\Mike/.qgis2/python/plugins\\opengeo', 'C:/PROGRA~1/QGISDU~1/apps/qgis/./python/plugins\\processing', 'C:/PROGRA~1/QGISDU~1/apps/qgis/./python', 'C:\\Users\\Mike/.qgis2/python', 'C:\\Users\\Mike/.qgis2/python/plugins', 'C:/PROGRA~1/QGISDU~1/apps/qgis/./python/plugins', 'C:\\PROGRA~1\\QGISDU~1\\bin\\python27.zip', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\DLLs', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~1\\QGISDU~1\\bin', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\six-1.3.0-py2.7.egg', 'C:\\PROGRA~1\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\PROGRA~1\\QGISDU~1\\apps\\qgis\\python\\plugins\\fTools\\tools']

Wouldn't a simple message saying "Could not connect to GeoServer" suffice? :smile:

volaya commented 10 years ago

Fixed. Now errors are shown in the message bar, showing only the first line with the description. The full error trace is available clicking on a button in the bar, and can be read or sent as an error report.

Uncaptured errors are still shown like that, since that is the way QGIS shows them (there shouldn't be many of those...hopefully)

nuruladilla commented 9 years ago

Hi i encountered the same problem when trying to connected to geoserver using QGIS..can u guys help me how to solve the problem.thx

nuruladilla commented 9 years ago

@volaya