Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Error handling for circular references#36

Merged
Mte90 merged 1 commit intoMte90:masterfrom
bertilhatt:patch-1
Oct 16, 2018
Merged

Error handling for circular references#36
Mte90 merged 1 commit intoMte90:masterfrom
bertilhatt:patch-1

Conversation

@bertilhatt
Copy link
Copy Markdown
Contributor

Part of my Hacktober effort, sorry if this not very sophisticated

What

Following #35, I’ve added:

  • error handling for:
    • circular references;
    • use of non-supported languages;
  • some modularity.

Comment

I could not find a list of supported languages, so I’m just catching the file error; there should be a way to generate both the detection and the copy of the error message from the contents of the /words/ file.

I’m not sure if there could be other error in either store_new_argument function.

I have not found a testing framework.

_Part of my Hacktober effort, sorry if this not very sophisticated_

## What ## 
Following Mte90#35, I’ve added:
- error handling for:
  - circular references;
  - use of non-supported languages;
- some modularity.

## Comment ##

I could not find a list of supported languages, so I’m just catching the file error; there should be a way to generate both the detection and the copy of the error message from the contents of the `/words/` file.

I’m not sure if there could be other error in either `store_new_argument` function.

I have not found a testing framework.
@Mte90
Copy link
Copy Markdown
Owner

Mte90 commented Oct 16, 2018

Thanks for your contribution!
Yes a unit system is missing and #33 address that.
When I started the project was a tiny tool and grown but I didn't have time to do also that.
Anyway for tme the pr is fine (also for the code reorganization).
I would suggest to do the same improvements to https://github.com/Mte90/SyntaxAlert/blob/master/csvtoterms.py and maybe move the similar code to so we can avoid code duplication like in this case https://github.com/Mte90/SyntaxAlert/blob/master/utils/data_handlers.py

@Mte90 Mte90 self-requested a review October 16, 2018 18:59
Comment thread manageterms.py
def store_new_argument(_args_):
try:
lang_path = script_path + '/words/' + _args_.lang + '.json'
typo_data = open_typo_file(lang_path)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to add a check of the language file f exist, good catch!

@Mte90 Mte90 merged commit a8e422f into Mte90:master Oct 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants