Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle no matches #23

Open
gcrois opened this issue Nov 22, 2021 · 0 comments
Open

Gracefully handle no matches #23

gcrois opened this issue Nov 22, 2021 · 0 comments
Assignees

Comments

@gcrois
Copy link
Member

gcrois commented Nov 22, 2021

Current nonmatching errors produce the following output:


------------------------------------------------
Running Input...
------------------------------------------------

avocat> running command: git clone sijbdfga
out>
err> fatal: repository 'sijbdfga' does not exist
err>
avocat> (exitcode: 128 )

------------------------------------------------
Finding Solution...
------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/mnt/e/linhome/Projects/avocat/avocat/__main__.py", line 59, in <module>
    sol = avocat.db.find_sol(out, err)
  File "/mnt/e/linhome/Projects/avocat/avocat/db/__init__.py", line 33, in find_sol
    Qs = se.find_Qs(err)[:4]
  File "/mnt/e/linhome/Projects/avocat/avocat/db/stackexchange.py", line 93, in find_Qs
    raise Exception(f"failed to get any results from request: {req_url}")
Exception: failed to get any results from request: https://api.stackexchange.com/2.3/search/advanced?order=desc&sort=votes&q=fatal%3A+repository+%27sijbdfga%27+does+not+exist%0A&site=askubuntu&answers=1&filter=withbody&key=d3qKMek1GCXs8ED6ee6ANA((```

Whenever possible, we should avoid using python's native exception handler for the outword-facing version of the UI.

Perhaps we could ask the user if they want to construct their own query?
@gcrois gcrois added this to the Ready For Study milestone Nov 22, 2021
@gcrois gcrois self-assigned this Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant