Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How can I make my method stop caring about the possible exception threw by void methods it called ?

$
0
0
Hello everyone,
I've figured out that when a method call another method, the prior "pauses" until the called one is done.

Here is an illustration :

Code (CSharp):
  1. void Start()
  2.     {
  3.         print("step 1 successful");
  4.         SimulateAnError();
  5.         print("step 2 successful");
  6.     }
  7.     public void SimulateAnError()
  8.     {
  9.         throw new System.Exception();
  10.         //the code stops here.
  11.     }
In this exemple, the "step 2" thing is not printed : the failure of the called...

How can I make my method stop caring about the possible exception threw by void methods it called ?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>