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

Add explanation to info exception. #236

Merged
merged 1 commit into from
Jun 4, 2021

Conversation

niyarin
Copy link
Contributor

@niyarin niyarin commented Jun 2, 2021

I added exception information about which INFO key is the problem to make it easier to understand the exception when reading the VCF, such as missing a reserved INFO key.

I've seen type errors during INFO parsing in the past, but I lost the VCF file that caused it, so I didn't add any other checking features this time.Then I had Cljam read some VCF files (known databases and others) and found no other problems, so I'll do the rest when I find them.

@niyarin niyarin requested review from alumi and a team as code owners June 2, 2021 03:27
@niyarin niyarin requested review from xckitahara and removed request for a team June 2, 2021 03:27
@niyarin
Copy link
Contributor Author

niyarin commented Jun 2, 2021

The comment by linter has nothing to do with this code change.

@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Merging #236 (51d7fcf) into master (84a55b5) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
- Coverage   88.75%   88.73%   -0.03%     
==========================================
  Files          76       76              
  Lines        6298     6301       +3     
  Branches      436      436              
==========================================
+ Hits         5590     5591       +1     
- Misses        272      274       +2     
  Partials      436      436              
Impacted Files Coverage Δ
src/cljam/io/vcf/util.clj 92.57% <50.00%> (-0.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84a55b5...51d7fcf. Read the comment docs.

Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

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

Thank you for the change 👍

Comment on lines 43 to 46
(when-not (parser-map k)
(throw (ex-info (str "Undeclared INFO, " k ".")
{:info ss})))
[(keyword k) ((parser-map k) vs)])))))))))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(when-not (parser-map k)
(throw (ex-info (str "Undeclared INFO, " k ".")
{:info ss})))
[(keyword k) ((parser-map k) vs)])))))))))
(if-let [parser (parser-map k)]
[(keyword k) (parser vs)]
(throw (ex-info (str "Undeclared INFO, " k ".")
{:info ss}))))))))))))

@niyarin niyarin force-pushed the feature/add-explanation-to-info-exception branch from b68d66e to 1b5ce57 Compare June 3, 2021 06:02
@niyarin niyarin force-pushed the feature/add-explanation-to-info-exception branch from 1b5ce57 to 51d7fcf Compare June 3, 2021 06:03
@niyarin
Copy link
Contributor Author

niyarin commented Jun 3, 2021

Thank you , my code was a bit verbose.
I fixed them.

Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks!!

Copy link
Contributor

@xckitahara xckitahara left a comment

Choose a reason for hiding this comment

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

LGTM:+1:

@alumi alumi merged commit cbaff3c into master Jun 4, 2021
@alumi alumi deleted the feature/add-explanation-to-info-exception branch June 4, 2021 02:12
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

Successfully merging this pull request may close these issues.

None yet

3 participants