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

coverage#CreateReport: move assertions up #23

Merged
merged 1 commit into from
May 25, 2018
Merged

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Sep 21, 2017

This makes it easier in case of errors to see where it is coming from.

This makes it easier in case of errors to see where it is coming from.
@dbarnett
Copy link
Contributor

dbarnett commented Oct 9, 2017

Can you give more context, like what the error looks like w/ and w/o? We use this convention widely across all our plugins, and it'd be unfortunate if the errors aren't precise, but also I'm hesitant to start unwinding this kind of thing everywhere it appears and I don't see any special reason we'd do it here and not everywhere else.

@blueyed
Copy link
Contributor Author

blueyed commented May 4, 2018

Currently I am seeing:

Error rendering coverage: ERROR(WrongType): Expected a list. Got a null.

(using google/vim-maktaba#213 to fix the type name)

The error will be the same, but it's easier to figure out where it's coming, since you can easily comment the lines. Not very helpful altogether, but I guess that's where this PR comes from.

When throwing a custom exception you see that it is coming via function coverage#Show[5]..<SNR>110_CoverageShow[9]..coverage#ShowCoverage[45]..15[21]..coverage#CreateReport.

Therefore additionally/instead v:throwpoint should get added to caught exceptions to aid debugging in case of errors.
With v:throwpoint and this PR you will have the correct error line (since previously it's a single line).

@blueyed
Copy link
Contributor Author

blueyed commented May 4, 2018

The error/issue I was seeing: #30

@dbarnett
Copy link
Contributor

Sounds like you're saying the issue is that there are 3 ensures in the same statement. We should probably change it around to give a more useful error if it's important that the errors are useful. I guess you can proceed w/ splitting these out if it helps.

@blueyed
Copy link
Contributor Author

blueyed commented May 23, 2018

Yup, thanks!

@dbarnett
Copy link
Contributor

(I approved. You have a button to merge the changes now, right?)

@blueyed
Copy link
Contributor Author

blueyed commented May 24, 2018

@dbarnett

You have a button to merge the changes now, right?

No.
Did I miss an invite?

@dbarnett dbarnett merged commit 1bb5a1a into google:master May 25, 2018
@dbarnett
Copy link
Contributor

I approved them so I thought you could. Anyway, I merged them for you.

@blueyed blueyed deleted the minor branch May 26, 2018 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants