-
Notifications
You must be signed in to change notification settings - Fork 59
[generator] Gracefully handle BindingGeneratorException. #845
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
Changes from all commits
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 |
---|---|---|
|
@@ -22,11 +22,19 @@ public class CodeGenerator | |
{ | ||
public static int Main (string[] args) | ||
{ | ||
var options = CodeGeneratorOptions.Parse (args); | ||
if (options == null) | ||
try { | ||
var options = CodeGeneratorOptions.Parse (args); | ||
if (options == null) | ||
return 1; | ||
|
||
Run (options); | ||
} catch (BindingGeneratorException) { | ||
return 1; | ||
} catch (Exception ex) { | ||
Console.Error.WriteLine (Report.Format (true, 0, null, -1, -1, ex.ToString ())); | ||
return 1; | ||
} | ||
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. Should other exception types be handled, "just in case", so that we don't get the "unhandled exception" output? Or do we want the unhandled exception output? 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. Makes sense, added. |
||
|
||
Run (options); | ||
return 0; | ||
} | ||
|
||
|
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.
Why don't we want to include
e
anymore?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.
We don't use it anywhere, we simply print out the localized message.