scientistproject / Scientist.net

A .NET library for carefully refactoring critical paths. It's a port of GitHub's Ruby Scientist library
MIT License
1.46k stars 95 forks source link

Included information about the operation type that threw the exception. #98

Closed Silvenga closed 6 years ago

Silvenga commented 7 years ago

When an error occurs within the publisher (and other locations), to a new developer, the stack trace may be confusing, e.g.

System.AggregateException: One or more errors occurred. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at GitHub.Internals.Experiment`2.<>c.<.cctor>b__39_1(Operation operation, Exception exception)
   at GitHub.Internals.ExperimentInstance`2.<Run>d__15.MoveNext()

This pull includes additional information when exceptions are thrown using default configurations.

Silvenga commented 7 years ago

Not sure where this issue is with AppVeyor - that should be completely valid C#.

VS17 can build the project - although Resharper is freaking out about other things. I can't actually edit the project without auto-upgrading the xproj to csproj.

joncloud commented 7 years ago

Looks great! Do you think we can write some unit tests to verify the exception that gets thrown from the default implementation?

haacked commented 6 years ago

Nice work! Sorry it took me so long to get to this.