Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does catch { throw; } do? [duplicate]

Tags:

c#

I just found this gem in the pile of spaghetti I have to maintain:

try { Foo(); }
catch { throw; }

Is it safe to replace it with

Foo();

?

like image 799
Ansis Māliņš Avatar asked Mar 19 '26 15:03

Ansis Māliņš


1 Answers

Yes. It's exactly the same. Maybe someone used it to put a breakpoint in the catch block.

like image 60
nvoigt Avatar answered Mar 21 '26 05:03

nvoigt