The throw statement is leaving the system inconsistent

1

I have a try..catch and in catch the colleague who did leave just throw.

catch(){throw;}

Well, my intention is to treat all this exceptions and not only leave throw . But as I arrived here in the company, I arrived and have to solve problems and code new features. It turns out, that I discovered today that in the production environment simply leaving throw as is, it stumbles in the system with different unexpected behaviors. Well, the answer is to treat throw . What I would like to know is what happens with throw so it gives this type of error in certain environments and others do not. The production environment our user accesses via portal, since they are in several places (states) of the country. In the Develop or Homol environment, the mounted url of access to the system is very simple, type: localhost:porta/Default.aspx , in homol we have something like: brcohmlg:porta/Default.aspx , now in production no. The url mounted is very complex, much larger than this and I do not know if that has anything to do with it.

    
asked by anonymous 27.11.2014 / 16:49

1 answer

8

The use of the throw statement alone within the catch() block causes the captured exception to be thrown again, has the same effect as there was no block try/catch

If there is any inconsistency in the behavior of the system, I think it does not have to be with throw per se, but rather with the type of error being caught / thrown.

    
27.11.2014 / 17:08