Comments
Sort by recent activity
Ok, in my usercode i have this public void Foo()
{
// here I would like to throw an exception and continue
throw new Exception("I want this to report, but continue");
}
public void Foo2()
{
throw new Exception("I want this to report, and not continue");
}
public class UnhandledExceptionHandlerWithoutUI : UnhandledExceptionHandler
{
protected override void OnReportException(ReportExceptionEventArgs e)
{
// handle/report it
if (/* WHAT GOES HERE? */)
e.TryToContinue = false;
else
e.TryToContinue = true;
}
}
My question is, what goes into the /* WHAT GOES HERE? */ that will make calls to Foo() and Foo2() behave as I desire? / comments
Ok, in my usercode i have thispublic void Foo()
{
// here I would like to throw an exception and continue
throw new Exception("I want this to report, but continue");
...
I realised I was thinking about this in completely the wrong way. Whatever code I had in my OnReportException(ReportExceptionEventArgs e) handler is what I should be putting into my catch brace - thanks. / comments
I realised I was thinking about this in completely the wrong way. Whatever code I had in my OnReportException(ReportExceptionEventArgs e) handler is what I should be putting into my catch brace - t...
actually I can't - no way to actually send an exception report from outside of the OnReportException handler.
Brian: My question was basically what should I put in my catch (Exception e) {} block to be able to set ReportExceptionEventArgs#TryToContinue = true; ?
I'm not seeing an immediate way to deal with this except either with static variables or wrapping the exception. The latter is the cleanest solution I can think of but it is still not particularly elegant.
This is more of a design question than a technical smartassembly question, although I do want to make sure I'm not missing something obvious in the API. / comments
actually I can't - no way to actually send an exception report from outside of the OnReportException handler.
Brian: My question was basically what should I put in my catch (Exception e) {} block t...
I want to report the exception, and then continue.
I don't see how I can report the exception without re-throwing it for SmartAssembly to handle via the OnReportException method. And once rethrown I don't see any way to control the continue parameters short of wrapping it in a customized exception. / comments
I want to report the exception, and then continue.
I don't see how I can report the exception without re-throwing it for SmartAssembly to handle via the OnReportException method. And once rethrown ...
Thanks James, I had been looking in Program Files. / comments
Thanks James, I had been looking in Program Files.