Update EquationViewModel.cpp error handling

Catching unhandled exceptions instead of crashing
This commit is contained in:
Frahman 2023-12-03 00:18:23 -05:00 committed by GitHub
commit 277097d9f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,6 +51,8 @@ namespace CalculatorApp::ViewModel
}
void EquationViewModel::PopulateKeyGraphFeatures(KeyGraphFeaturesInfo ^ graphEquation)
{
try
{
if (graphEquation->AnalysisError != 0)
{
@ -95,6 +97,12 @@ namespace CalculatorApp::ViewModel
AnalysisErrorVisible = false;
}
catch (Exception^ ex)
{
AnalysisErrorVisible = true;
AnalysisErrorString = "Invalid input: " + ex->Message;
}
}
void EquationViewModel::AddKeyGraphFeature(String ^ title, String ^ expression, String ^ errorString)
{