c# - Catching errors from new T() -


i use pattern lazy loading base screen class:

public class basescreen {     public void goto<t>(t t) t : basescreen, new(){         if (t == null)             t = new t();          navigatoncontroller.pushviewcontroller(t,true);     } } 

but have run situation don't like. when exception thrown in process of constructing t, exception ignored instead excepton @ t = new t(). says like: exception has been thrown target of invocation. doesn't give hint of real exception happened. have tried catching still found no info. of course, found know if there way catch these errors directly. throw exceptions me know if have done wrong pointless if exception going see 1 mentioned before. therefore, can something? or poor pattern?

you should check innerexception real cause of error


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -