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

Better error messages for better UX #162

Open
SamuelLarkin opened this issue Jul 29, 2024 · 0 comments
Open

Better error messages for better UX #162

SamuelLarkin opened this issue Jul 29, 2024 · 0 comments

Comments

@SamuelLarkin
Copy link
Contributor

Hi,
I ran mtdata get --langs fra-eng --train Statmt-news_commentary-18.1-por --no-merge --compress --out delme and I got the following output:

2024-07-29 08:50:03 main.get_data:43 INFO:: Args are ignored: {'verbose': False, 'log_level': 'INFO', 'reindex': False, 'progressbar': True, 'task': 'get', 'test_dids': None, 'dev_dids': None}
Traceback (most recent call last):
  File "/gpfs/projects/DT/mtp/corpora/MSLC24/venv/bin/mtdata", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/gpfs/projects/DT/mtp/corpora/MSLC24/venv/lib/python3.11/site-packages/mtdata/__main__.py", line 9, in main
    main.main()
  File "/gpfs/projects/DT/mtp/corpora/MSLC24/venv/lib/python3.11/site-packages/mtdata/main.py", line 324, in main
    get_data(**vars(args))
  File "/gpfs/projects/DT/mtp/corpora/MSLC24/venv/lib/python3.11/site-packages/mtdata/main.py", line 46, in get_data
    dataset = Dataset.prepare(
              ^^^^^^^^^^^^^^^^
  File "/gpfs/projects/DT/mtp/corpora/MSLC24/venv/lib/python3.11/site-packages/mtdata/data.py", line 119, in prepare
    raise Exception(f'Given languages: {langs} and dataset: {ent.did} are not compatible')
Exception: Given languages: (BCP47(fra), BCP47(eng)) and dataset: Statmt-news_commentary-18.1-por are not compatible

I would like to suggest to catch that exception and only print a clean error message, one without the stack trace as it isn't useful for a user. I think it would help the user experience.

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