bcgov / bcgov/ligo-lib

General Exception and Error Checking

Open
#12 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

What if file open fails here https://github.com/bcgov-c/data-linking/blob/develop/cdi-linking/cdilinker/linker/commands.py#L10 ?

Should not there be some check and return instead of doing conditional importing few lines down (in the same file)? https://github.com/bcgov-c/data-linking/blob/develop/cdi-linking/cdilinker/linker/commands.py#L137

Same here: https://github.com/bcgov-c/data-linking/blob/develop/cdi-linking/cdilinker/linker/chunked_link.py#L194 ... what if the file does not exist?
There are more statements like this in the same file. Please consider those as well. Thanks.

The exception handlers are too open or generic (which is not a good practice)
https://github.com/bcgov-c/data-linking/blob/develop/web/linkage/linkage/linking/forms.py#L59
https://github.com/bcgov-c/data-linking/blob/develop/web/linkage/linkage/linking/forms.py#L98
There are similar statements in utils.py too. Let's try to be more specific if/wherever we can.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked sections of cdi-linking/cdilinker/linker/commands.py and chunked_link.py, then inspect the related handlers in web/linkage/linkage/linking/forms.py and utils.py. Trace the file-open, import, and exception paths before deciding what failures need handling. Done means the mentioned paths handle missing files appropriately and overly generic handlers are narrowed where possible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.