-
Notifications
You must be signed in to change notification settings - Fork 100
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
04157a1
ce90729
eb44963
5bf4cca
f346f9f
4793aa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
{ | ||
if (ExceptionUtil.IsProgrammingDefect(ex)) | ||
{ | ||
throw; // Let it fall through so we hear about it on ExceptionWeb | ||
} | ||
else | ||
{ | ||
errorList.Add(new TransitionImportErrorInfo(ex.Message, null, null, string.Empty)); | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
|
@@ -1544,6 +1555,17 @@ public SrmDocument ImportMassList(MassListInputs inputs, | |
{ | ||
errorList.Add(new TransitionImportErrorInfo(x)); | ||
} | ||
catch (Exception ex) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
{ | ||
if (ExceptionUtil.IsProgrammingDefect(ex)) | ||
{ | ||
throw; // Let it fall through so we hear about it on ExceptionWeb | ||
} | ||
else | ||
{ | ||
errorList.Add(new TransitionImportErrorInfo(ex.Message, null, null, string.Empty)); | ||
} | ||
} | ||
} | ||
return docNew; | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.