public static T TryGet<T>(Func<T> func, T ifError = default(T)) {
try {
return func();
} catch {
return ifError;
}
}

string a;
try{ a = doooooooooo(); } catch { a = "wrewre"; }

//this is shit!

var a = TryGet(doooooooooo, "wrewre");

//great!

05-11 11:22