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

avoid printing traceback for console script errors #29

Open
kalenkovich opened this issue Sep 26, 2023 · 0 comments
Open

avoid printing traceback for console script errors #29

kalenkovich opened this issue Sep 26, 2023 · 0 comments
Assignees

Comments

@kalenkovich
Copy link
Contributor

This error message:

Traceback (most recent call last):
  File "\\?\C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\Scripts\vihi-script.py", line 33, in <module>
    sys.exit(load_entry_point('blabpy', 'console_scripts', 'vihi')())
  File "C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\evk465\blab\blabpy\repo\blabpy\vihi\cli.py", line 44, in start
    annotation_folder = checkout_recording_for_annotation(full_recording_id=recording_id, annotator_name=name)
  File "c:\users\evk465\blab\blabpy\repo\blabpy\vihi\annotating.py", line 12, in checkout_recording_for_annotation
    pn_opus_repo_path = get_lena_path()
  File "c:\users\evk465\blab\blabpy\repo\blabpy\vihi\paths.py", line 36, in get_lena_path
    return _get_modality_path('LENA')
  File "c:\users\evk465\blab\blabpy\repo\blabpy\vihi\paths.py", line 28, in _get_modality_path
    return get_subject_files_path() / modality
  File "c:\users\evk465\blab\blabpy\repo\blabpy\vihi\paths.py", line 20, in get_subject_files_path
    return get_vihi_path() / 'SubjectFiles'
  File "c:\users\evk465\blab\blabpy\repo\blabpy\vihi\paths.py", line 12, in get_vihi_path
    return get_pn_opus_path() / 'VIHI'
  File "c:\users\evk465\blab\blabpy\repo\blabpy\paths.py", line 53, in get_pn_opus_path
    raise _get_pn_opus_path_error(checked_paths=str_paths)
ValueError: Could not locate PN-OPUS at any of the following paths:

- /Volumes/pn-opus/, Z:\

Follow these steps:
- Check that you are connected to the Duke VPN.
- Check that PN-OPUS is mounted.
- Check that it is mounted to one of the default locations:

  - /Volumes/pn-opus/, Z:\

  If it is mounted elsewhere, either remount it or set an
  environment variable PN_OPUS_PATH to the mount location.

would be much more readable if the traceback was removed:

ValueError: Could not locate PN-OPUS at any of the following paths:

- /Volumes/pn-opus/, Z:\

Follow these steps:
- Check that you are connected to the Duke VPN.
- Check that PN-OPUS is mounted.
- Check that it is mounted to one of the default locations:

  - /Volumes/pn-opus/, Z:\

  If it is mounted elsewhere, either remount it or set an
  environment variable PN_OPUS_PATH to the mount location.

Ideally, there would be a --DEBUG flag that would put the traceback in.

@kalenkovich kalenkovich self-assigned this Sep 26, 2023
@kalenkovich kalenkovich changed the title avoid traceback for console scripts avoid printing traceback for console script errors Sep 26, 2023
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