{"action":"created","issue":{"url":"https://api.github.com/repos/obspy/obspy/issues/1162","labels_url":"https://api.github.com/repos/obspy/obspy/issues/1162/labels{/name}","comments_url":"https://api.github.com/repos/obspy/obspy/issues/1162/comments","events_url":"https://api.github.com/repos/obspy/obspy/issues/1162/events","html_url":"https://github.com/obspy/obspy/issues/1162","id":114312014,"number":1162,"title":"Catch invalid URL when initialising FDSN Client","user":{"login":"petrrr","id":3065632,"avatar_url":"https://avatars.githubusercontent.com/u/3065632?v=3","gravatar_id":"","url":"https://api.github.com/users/petrrr","html_url":"https://github.com/petrrr","followers_url":"https://api.github.com/users/petrrr/followers","following_url":"https://api.github.com/users/petrrr/following{/other_user}","gists_url":"https://api.github.com/users/petrrr/gists{/gist_id}","starred_url":"https://api.github.com/users/petrrr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrrr/subscriptions","organizations_url":"https://api.github.com/users/petrrr/orgs","repos_url":"https://api.github.com/users/petrrr/repos","events_url":"https://api.github.com/users/petrrr/events{/privacy}","received_events_url":"https://api.github.com/users/petrrr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/obspy/obspy/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/obspy/obspy/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-30T17:01:23Z","updated_at":"2015-10-31T10:55:30Z","closed_at":null,"body":"I just ran into a small problem (my error by the way) which surprise me and kept me occupied a bit. I was using the FDSN client, but misspelled one abbreviation. More precisely I misspelled it when filing #1010 and 3fa60b82 some time back. Now I myself hit the bug. \r\n\r\nHowever, I would like to propose that invalid URL and not existing abbreviations respectively are caught and reported explicitly back to the user.\r\n\r\nHere is what currently happens:\r\n\r\n```python\r\nc = obspy.fdsn.Client(\"NIEP\", debug=False)\r\n\r\n---------------------------------------------------------------------------\r\nFDSNException                             Traceback (most recent call last)\r\n<ipython-input-23-c88aacea7384> in <module>()\r\n----> 1 c = obspy.fdsn.Client(\"NIEP\", debug=False)\r\n\r\n/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/obspy/fdsn/client.py in __init__(self, base_url, major_versions, user, password, user_agent, debug, timeout, service_mappings)\r\n    150             print(\"Request Headers: %s\" % str(self.request_headers))\r\n    151 \r\n--> 152         self._discover_services()\r\n    153 \r\n    154     def get_events(self, starttime=None, endtime=None, minlatitude=None,\r\n\r\n/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/obspy/fdsn/client.py in _discover_services(self)\r\n   1318                    \"be due to a temporary service outage or an invalid FDSN \"\r\n   1319                    \"service address.\" % self.base_url)\r\n-> 1320             raise FDSNException(msg)\r\n   1321 \r\n   1322         # Cache.\r\n\r\nFDSNException: No FDSN services could be discovered at 'NIEP'. This could be due to a temporary service outage or an invalid FDSN service address.\r\n``` \r\n\r\nOr with debugging enabled:\r\n```python\r\nBase URL: NIEP\r\nRequest Headers: {'User-Agent': 'ObsPy 0.10.2 (Darwin-14.5.0-x86_64-i386-64bit, Python 3.4.3)'}\r\nDownloading NIEP/fdsnws/dataselect/1/application.wadl\r\nError while downloading: NIEP/fdsnws/dataselect/1/application.wadl\r\nDownloading NIEP/fdsnws/event/1/application.wadl\r\nError while downloading: NIEP/fdsnws/event/1/application.wadl\r\nDownloading NIEP/fdsnws/station/1/application.wadl\r\nError while downloading: NIEP/fdsnws/station/1/application.wadl\r\nDownloading NIEP/fdsnws/event/1/catalogs\r\nError while downloading: NIEP/fdsnws/event/1/catalogs\r\nDownloading NIEP/fdsnws/event/1/contributors\r\nError while downloading: NIEP/fdsnws/event/1/contributors\r\n---------------------------------------------------------------------------\r\nFDSNException                             Traceback (most recent call last)\r\n[... more output as above]\r\n```"},"comment":{"url":"https://api.github.com/repos/obspy/obspy/issues/comments/152722603","html_url":"https://github.com/obspy/obspy/issues/1162#issuecomment-152722603","issue_url":"https://api.github.com/repos/obspy/obspy/issues/1162","id":152722603,"user":{"login":"megies","id":1842780,"avatar_url":"https://avatars.githubusercontent.com/u/1842780?v=3","gravatar_id":"","url":"https://api.github.com/users/megies","html_url":"https://github.com/megies","followers_url":"https://api.github.com/users/megies/followers","following_url":"https://api.github.com/users/megies/following{/other_user}","gists_url":"https://api.github.com/users/megies/gists{/gist_id}","starred_url":"https://api.github.com/users/megies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/megies/subscriptions","organizations_url":"https://api.github.com/users/megies/orgs","repos_url":"https://api.github.com/users/megies/repos","events_url":"https://api.github.com/users/megies/events{/privacy}","received_events_url":"https://api.github.com/users/megies/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T10:55:30Z","updated_at":"2015-10-31T10:55:30Z","body":"The current error message is relatively OK I think, but I don't mind if you make a PR with an even clearer message. I guess it's a pretty sane assumption that any URL checked for a FDSN service should start with `http://`.."}}