Skip to content

Improve exception message #569

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

Merged

Conversation

daveMueller
Copy link
Collaborator

closes #459

@daveMueller
Copy link
Collaborator Author

image

@MarcoRossignoli MarcoRossignoli added the enhancement General enhancement request label Sep 26, 2019
@@ -165,15 +165,33 @@ private void OnSessionEnd(object sender, SessionEndEventArgs e)
/// <returns>Test modules list</returns>
private IEnumerable<string> GetTestModules(SessionStartEventArgs sessionStartEventArgs)
{
var testModules = sessionStartEventArgs.GetPropertyValue<IEnumerable<string>>(CoverletConstants.TestSourcesPropertyName);
if (_eqtTrace.IsInfoEnabled)
IEnumerable<string> testModules;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not

 private IEnumerable<string> GetTestModules(SessionStartEventArgs sessionStartEventArgs)
        {
            try
            {
                IEnumerable<string> testModules = GetPropertyValueWrapper(sessionStartEventArgs);
                if (_eqtTrace.IsInfoEnabled)
                {
                    _eqtTrace.Info("{0}: TestModules: '{1}'",
                        CoverletConstants.DataCollectorName,
                        string.Join(",", testModules ?? Enumerable.Empty<string>()));
                }
                return testModules;
            }
            catch (MissingMethodException ex)
            {
                throw new MissingMethodException("Make sure to use .NET core SDK Version >= 2.2.300", ex);
            }
        }

Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli left a comment

Choose a reason for hiding this comment

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

LGTM!

@MarcoRossignoli MarcoRossignoli merged commit 0614f87 into coverlet-coverage:master Sep 30, 2019
@daveMueller daveMueller deleted the 459_ImproveExceptionMessage branch October 1, 2019 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve exception message for sdk that doesn't support collectors
2 participants