Sometimes, tracking down exceptions occurring in EPPlus can be more difficult than necessary, due to some *catch* blocks throwing catched exceptions again,instead of rethrowing them.
The difference in code is minimal, but the outcome can be radically different.
```
catch (Exception ex)
{
throw (ex); // Lose the exception's original stack frame
// Now the exception appears to have originated on the previous line,
// which is misleading and unnecessarily complicates debugging
}
```
Code like the above (without the comments, that is) appears in at least 4 places in EPPlus. It's probably better to change it to:
```
catch (Exception ex)
{
throw; // Preserve the exception's stack frame
}
```
The difference in code is minimal, but the outcome can be radically different.
```
catch (Exception ex)
{
throw (ex); // Lose the exception's original stack frame
// Now the exception appears to have originated on the previous line,
// which is misleading and unnecessarily complicates debugging
}
```
Code like the above (without the comments, that is) appears in at least 4 places in EPPlus. It's probably better to change it to:
```
catch (Exception ex)
{
throw; // Preserve the exception's stack frame
}
```