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

Add better exception handling in transition list input - in particular make the FileModifiedException more informative #3202

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bspratt
Copy link
Member

@bspratt bspratt commented Oct 18, 2024

…r make the FileModifiedException more informative
@@ -1509,6 +1509,17 @@ public SrmDocument ImportMassList(MassListInputs inputs,
Replace(TextUtil.SEPARATOR_TSV_STR, @" ");
errorList.Add(new TransitionImportErrorInfo(x.PlainMessage, x.ColumnIndex, x.LineNumber + 1, line)); // CONSIDER: worth the effort to pull row and column info from error message?
}
catch (Exception ex)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the right place to put this. This is supposed to be for issues with parsing a line, not for global errors. You should be catching other exceptions higher up the callstack.

Copy link
Member Author

Choose a reason for hiding this comment

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

Catching it here is advantageous as it ties into the reporting mechanism for both the UI and commandline use cases.

@@ -1544,6 +1555,17 @@ public SrmDocument ImportMassList(MassListInputs inputs,
{
errorList.Add(new TransitionImportErrorInfo(x));
}
catch (Exception ex)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the right place to put this. This is supposed to be for issues with parsing a line, not for global errors. You should be catching other exceptions higher up the callstack.

Copy link
Member Author

Choose a reason for hiding this comment

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

Catching it here is advantageous as it ties into the reporting mechanism for both the UI and commandline use cases.

@bspratt
Copy link
Member Author

bspratt commented Nov 12, 2024

@brendanx67 do you still want to change this? I could add two sets of error handling (UI and commandline) if you feel strongly about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants