Lean
Lean copied to clipboard
Improve exception message when generating Annual Performance Statistic
Description
The exception message thrown when the casting from double to decimal was done at PortfolioStatistics.GetAnnualPerformance(), didn't provide enough information regarding the reason behind the failure. Now, the message is more informative, pointing out explicitly which performance point is producing the error. Furthermore, the error was produced because of a bug in the quote file data.
Related Issue
Closes #7888
Motivation and Context
With this change if an exception is thrown while casting the annual performance to decimal, the exception message will be more informative.
Requires Documentation Change
N/A
How Has This Been Tested?
To test the exception message was the expected one the code provided in the issue was run.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Refactor (non-breaking change which improves implementation)
- [ ] Performance (non-breaking change which improves performance. Please add associated performance test and results)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Non-functional change (xml comments/documentation/etc)
Checklist:
- [x] My code follows the code style of this project.
- [x] I have read the CONTRIBUTING document.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] My branch follows the naming convention
bug-<issue#>-<description>orfeature-<issue#>-<description>