BergelsonLab / BergelsonLab/blabpy

avoid printing traceback for console script errors

Open
#29 0 comments 0 reactions 1 assignee Claimed by @kalenkovich View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This error message:

```bash
Traceback (most recent call last):
File "\\?\C:\Users\evk465\AppData\Local\mambaforge-pypy3\envs\blabpy\Scripts\vihi-script.py", line 33, in
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:

```bash
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.