This `try` block is probably way too big. It looks like only `_extract_extra_options` on line 35 might throw InvalidURI, then the `except` basically acts as a goto.