fpanaccia / Wkhtmltopdf.NetCore-deprecated

Rotativa + Net Core
The Unlicense
220 stars 94 forks source link

Don't catch-and-throw #29

Closed bryanboettcher closed 4 years ago

bryanboettcher commented 4 years ago

In files like this: https://github.com/fpanaccia/Wkhtmltopdf.NetCore/blob/master/Wkhtmltopdf.NetCore/Implementation/GeneratePdf.cs

Near the bottom, there are several catch(Exception e) { throw e; } statements. Throwing exceptions in this manner will reset the stack trace, making debugging difficult. If you are just going to rethrow, don't bother catching at all. If you need to log, or something, use the "e" you caught, but just use the statement "throw;" to rethrow it.

fpanaccia commented 4 years ago

Hi!, yes, you are right! i added them for testing and then forget about them.