File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,22 @@ g.help('address')
145145g.help(' input' )
146146```
147147
148+ ### Error Handling
149+
150+ python-geosupport will raise a ` GeosupportError ` when Geosupport returns an
151+ error code. Sometimes there is more information returned, in which case the
152+ exception will have a ` result ` dictionary.
153+
154+ ``` python
155+ from geosupport import GeosupportError
156+
157+ try :
158+ g.get_street_code(borough = ' MN' , street = ' Wort Street' )
159+ except GeosupportError as e:
160+ print (e) # 'WORT STREET' NOT RECOGNIZED. THERE ARE 010 SIMILAR NAMES.
161+ print (e.result[' List of Street Names' ]) # List of suggested alternate names
162+ ```
163+
148164## Development
149165
150166### Running tests
Original file line number Diff line number Diff line change 1- from .geosupport import Geosupport
1+ from .geosupport import Geosupport , GeosupportError
You can’t perform that action at this time.
0 commit comments