-
Notifications
You must be signed in to change notification settings - Fork 563
WIP Feature/emit processor #313
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
Conversation
| public void Register(ICodeSubmissionProcessor processor) | ||
| public void Add(ICodeSubmissionProcessor processor) | ||
| { | ||
| _processors[processor.Command] = processor; |
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.
Add seems like a misleading name if this can also replace an existing processor.
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.
changed to add so we throw exceptions when overriding
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.
This still obscure the intention. A more honest name would be something like SetProcessorForCommand.
|
|
||
| return new SubmitCode(string.Join("\n", unhandledLines), codeSubmission.Id, codeSubmission.ParentId); | ||
| } | ||
| catch (Exception e) |
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.
This seems overly broad. We should ideally only catch exceptions that we understand, as this might otherwise mask some of our own bugs.
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.
that is wrapping all exceptions so we capture the exception and the code submission
| var renderer = FindRenderer(source.GetType()); | ||
| return renderer.Render(source, this); | ||
| } | ||
| catch (Exception e) |
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.
Is there a specific reason (e.g. expected exception type) to do this? catch Exception is something that should typically only ever happen at a much higher level in the code.
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.
this one is wrapping as well, and capturing the evaluation result
|
|
||
| var state = getScriptState(); | ||
|
|
||
| var codeFile = new FileInfo(Path.Combine(options.Output.FullName, "code.cs")); |
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.
This should be made to work against IDirectoryAccessor from the outset.
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.
indeed
| { | ||
| public SubmitCode CodeSubmission { get; } | ||
|
|
||
| public CodeSubmissionProcessorException(Exception exception, SubmitCode codeSubmission) : base("CodeSubmission processing failed", exception) |
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.
It would also be helpful to refer to the processor that failed.
d556439 to
238d7ec
Compare
No description provided.