ThinkGeo.com    |     Documentation    |     Premium Support

Bad exception handling practices

// ThinkGeo.MapSuite.Wpf.Tile
///
/// This method draws the exception message when the drawing process is crashed.
///

///
/// This method is the concrete wrapper for the abstract method DrawExceptionCore.
///
/// This parameter is the canvas object to draw on.
/// This parameter is the real exception in during drawing process.
protected void DrawException(GeoCanvas geoCanvas, Exception exception)
{
DrawingExceptionMode drawingExceptionMode = this.DrawingExceptionMode;
if (drawingExceptionMode == DrawingExceptionMode.DrawException)
{
this.DrawExceptionCore(geoCanvas, exception);
return;
}
throw exception;// this is bad
}

I’d like to know why you guys throw exception explicitly? Since throw + exception will resets the original call stacks,make the exception very strange and very hard to investigate.
So I hope you guys can fix this.Try throw a custom exception contains original exception as inner exception.

Hi Karl,

I think currently exception handle logic have its strategy, but it shouldn’t be perfect solution. Thanks for your suggestion, I will let our developer know it.

If you met any detail problem when you debug your application please let us know, and our developer can help you on that.

We are keeping work to provide a better product for all users.

Regards,

Ethan